react-native 坑点总结

react-native 坑点总结


  1. 安卓:子元素设置-的margin,或者定位超出父容器的部分将不会展示出来。甚至给父元素设置overflow: ‘visible’也是不可以的。

  2. 安卓:TextInput的背景色更改不了

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // 给容器增加背景色
    <View style={styles.inputContainer}>
    <TextInput
    style={styles.textInput}
    underlineColorAndroid="transparent" // try
    onChangeText={this.onSearchChange}
    value={this.props.searchValue}
    placeholder="xxxx"
    onFocus={this.onFocus}
    onBlur={this.onBlur}
    />
    </View>
  3. iOS和安卓的盒模型不一致,iOS :content 安卓 : padding + content + border