我在使用React Native的ListView时遇到了一些麻烦,奇怪的行为是设置行的backgroundColor会在iPhone6和iPhone6plus之间执行不同的结果
我的代码在render()函数中
render: function(){
return (
<View>
<ListView
scrollEnabled={false}
contentContainerStyle={styles.list}
dataSource={dataSource.cloneWithRows(values)}
initialListSize={values.length}
pageSize={3}
scrollRenderAheadDistance={500}
renderRow={this._renderRow}
/>
</View>
);
},
Run Code Online (Sandbox Code Playgroud)
款式:
var styles = StyleSheet.create({
list: {
flexDirection: 'row',
flexWrap: 'wrap',
},
row: {
backgroundColor:'white',
width:w.width/3,
height: w.width/3,
borderWidth: 0.5,
borderColor: '#f3f3f3',
alignItems: 'center',
}});
Run Code Online (Sandbox Code Playgroud)
我正在尝试给一个 NSMutableArray 值“SEL”,而 XCode 给了我这个错误。我的代码:
SEL camera=@selector(p_userAlbum);
NSMutableArray *sels=@[camera].mutableCopy;
Run Code Online (Sandbox Code Playgroud)
如果有办法将 SEL 放入数组中?
#define SDNSPredicate(key,value) \
[NSPredicate predicateWithFormat:@"#key == %@",value];
Run Code Online (Sandbox Code Playgroud)
当我使用时SDNSPredicate(@"hCName",@"ccc"),我期待hCName == "ccc"但它变成了key == "ccc"
怎么做对了?