尝试在renderRow中显示列表项。
我已经在项目中实现了RTL,就像React Native文档中定义的那样,我通过
我正在尝试呈现一个设计好的表格单元格,因此它是一张图片,在这张图片上我正试图布置我的项目。 所以,该标志的样式定义如下:
结果令人失望。
以下是应该看起来的样子: 而现在却是这样: 最让我困扰的是,以前看起来还好,我不确定是什么原因导致了这种情况。
此外,在应用程序启动时,“Loading”文本显示在窗口右侧。
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>
);
}
结果令人失望。
以下是应该看起来的样子: 而现在却是这样: 最让我困扰的是,以前看起来还好,我不确定是什么原因导致了这种情况。
此外,在应用程序启动时,“Loading”文本显示在窗口右侧。