小编lsd*_*doy的帖子

React Native:在iphone6Plus中运行的ListView中的奇怪行为backgroundColor

我在使用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)

在iPhone6上运行,没关系! 在此输入图像描述

但在iPhone6Plus中运行 在此输入图像描述

listview ios react-native

2
推荐指数
1
解决办法
187
查看次数

'SEL' 类型的集合元素不是 Objective-C 对象

我正在尝试给一个 NSMutableArray 值“SEL”,而 XCode 给了我这个错误。我的代码:

SEL camera=@selector(p_userAlbum);
NSMutableArray *sels=@[camera].mutableCopy;
Run Code Online (Sandbox Code Playgroud)

如果有办法将 SEL 放入数组中?

objective-c ios

1
推荐指数
1
解决办法
754
查看次数

制作一个宏:如何正确嵌入字符串

#define SDNSPredicate(key,value) \
    [NSPredicate predicateWithFormat:@"#key == %@",value];
Run Code Online (Sandbox Code Playgroud)

当我使用时SDNSPredicate(@"hCName",@"ccc"),我期待hCName == "ccc"但它变成了key == "ccc"

怎么做对了?

macros objective-c

1
推荐指数
1
解决办法
82
查看次数

标签 统计

ios ×2

objective-c ×2

listview ×1

macros ×1

react-native ×1