2017-11-05 9 views
1

renderRow内のリストアイテムを表示しようとしています。 私は既にas defined on react native documentationプロジェクトでRTLを実装しており、console.log(I18nManager.isRTL ? 'yes' : 'no')が肯定的です。
私は設計された表のセルを表示しようとしています。そのため、画像の上にアイテムを配置しようとしています。 だから、ロゴは、このようなスタイルで定義されていますリアクションはネイティブで左になります

var styles = StyleSheet.create({ 
    logo:{ 
    position: 'absolute', 
    top:11, 
    right:11, 
    width: 26, 
    height: 26 
    } 
    frame: { 
    flex: 1, 
    flexDirection: 'row', 
    margin: 5, 
    }, 


txtFirstName:{ 
    position:'absolute', 
    top:7, 
    right:40, 
    marginRight:36, 
    color:'white', 
    fontSize:PixelRatio.get()*4/PixelRatio.getFontScale(), 
    fontWeight:'bold', 
    textAlign:'right', 
    textShadowColor: 'black', 
    textShadowOffset: {width:2,height:2}, 
    writingDirection : 'rtl' 
    }, 

txtSecondName:{ 
    position:'absolute', 
    top:17, 
    right:40, 
    marginRight:36, 
    color:'white', 
    fontSize:PixelRatio.get()*3/PixelRatio.getFontScale(), 
    fontWeight:'bold', 
    textAlign:'right', 
    textShadowColor: 'black', 
    textShadowOffset: {width:2,height:2}, 
    writingDirection : 'rtl' 
    }, 

txtMainText:{ 
    position:'absolute', 
    marginRight:36, 
    color:'white', 
    fontWeight:'bold', 
    textAlign:'right', 
    textShadowColor: 'black', 
    textShadowOffset: {width:2,height:2}, 
    writingDirection : 'rtl', 
    fontSize:PixelRatio.getPixelSizeForLayoutSize(3), 
    }, 

}); 

    renderRow(rowData, sectionID, rowID) { 
    return(
    <TouchableOpacity onPress={()=>this.showBusiness(rowData)}> 
     <View style={{flex:1}}> 
     <Image style={styles.logo} resizeMode = 'cover' source=}require('../images/logo.png’){/> 
     <Image source={require('../images/mainFrame.png’){ style={styles.frame}/> 
    <Text style={[styles.txtMainText,styles.txtFirstName]}> 
     טקסט 
    </Text> 
    <Text style={[styles.txtMainText,styles.txtSecondName]}> 
     מיושר לימין 
    </Text> 

     </View> 
    </TouchableOpacity> 
); 
    } 

結果は残念です。ここで

は、それがのようになります方法は次のとおりです。 enter image description here

、ここでそれが今ある方法は次のとおりです。 enter image description here

一番私を悩ますことは、それは大丈夫に見えるために使用されるということである、と私はわかりませんこのように何が吹いたのか?

また、アプリの起動時にウィンドウの右側に「読み込み中」のテキストが表示されます。

答えて

2

ドキュメントによると、「RTLレイアウトのコードの左端はすべて、画面上で「右」になり、右のコードは「左」になりますあなたのポジショニングのために、右の代わりに左を使うことを考えましたか?あるいは、希望の結果にフレックススタートまたはフレックスエンドを使用することを検討してください。

関連する問題