SafeAreaView没有填充电话头区域

时间:2019-04-09 02:22:35

标签: reactjs react-native

我正在为iOS开发一个react native应用。随附的SafeAreaView组件具有背景色,但iPhone X的顶部留有白色背景的空白空间。

我已经删除了SafeAreaView,但仍然看到顶部边缘的白色区域,该区域不会因填充背景色而受影响,除非加载背景图像。不确定为什么SafeAreaView没有覆盖手机顶部的整个SafeArea;只能走50%。

 <Fragment>

      <SafeAreaView style={{ flex: 0, backgroundColor: '#006600' }}  />
      <SafeAreaView style={{ flex: 1, backgroundColor: '#006600' }} > 
      <StatusBar barStyle='light-content' />
      <View style={styles.container}>
        <Header 
          headerText={'My Naija Calculator'} 
          backgroundColor = {'#006600'}
          color = { '#fff'}
          />

enter image description here

3 个答案:

答案 0 :(得分:0)

您使用$product_id = get_user_meta( get_current_user_id(), 'product_id', true ); // Get an instance of the WC_Product object from the product ID $product = wc_get_product( $product_id ); 错误

SafeAreaView的行为类似于SafeAreaView。您只需将其包装在所有子元素上一次

View

参考:https://facebook.github.io/react-native/docs/safeareaview

答案 1 :(得分:0)

对不起,我不好。我在一些被遗忘的边界视图组件中填充了20的填充。我删除了它,一切正常。

答案 2 :(得分:0)

<form method="POST" class="form-horizontal" enctype='multipart/form-data'>
  <tbody>
    <tr>
      <td><input type="text" id="chiefName" name="" pattern="[A-Za-z]{1,50}" title="Only letters are allowed." onchange="chiefEngineerName(this);" placeholder="" class="form-control"><span id="cError" class="help-block"></span></td>
      <td>
        <input type="file" name="chiefSign" accept="image/*" onchange="chiefEngineerSign(this), readURL2(this);
                                                                        capture = camera"><br><br>
        <div id="chiefSign"> <img id="displayImg2" height="100" width="100" /></div>
      </td>
      <td>
        <input type="file" name="chiefStamp" accept="image/*" onchange="chiefEngineerStamp(this), readURL3(this);
                                                                        capture = camera"><br><br>
        <div id="chiefStamp"> <img id="displayImg3" height="100" width="100" /></div>
      </td>
    </tr>
  </tbody>
  <input type="submit" class="btn btn-primary" value="Save">
</form>

您可以尝试

相关问题