2017-12-24 51 views
2

Viewは、親Viewコンポーネント内にあります。私は親の境界を設定しますが、子のViewの境界は親の境界を上書きします。ここで子ビューボーダーは、反応ネイティブの親のボーダーより優先されます。

は画面ここで

enter image description here

である私のコードは

<View style={{flexDirection: 'row',marginLeft: 20, marginRight: 20, height: height/20, 
        width: width-40, borderWidth: 2, borderRadius: 4, borderColor: '#D3D3D3'}}> 
        <View style={{backgroundColor: '#D3D3D3',flexDirection: 'row', 
         height: height/20, alignItems: 'center'}}> 
         <Thumbnail style={{marginLeft: 5,width: 20, height: 20}} square source={require('../assets/Turkey.png')}/> 
         <Picker mode="dropdown" selectedValue={this.state.selectedCountry} 
           onValueChange={(value)=>this.onCodeChanged(value)} 
           > 
          <Picker.Item label="+44" value="England"></Picker.Item> 
          <Picker.Item label="+90" value="Turkey"></Picker.Item> 
         </Picker> 
        </View> 
        <View style={{height: height/20, width: 250}}> 
         <Input placeholder="Phone" placeholderTextColor='#D3D3D3'/> 
        </View> 
       </View> 

である私は0に、子ビューのborderBottomWidth小道具を設定しようとしましたが、それはうまくいきませんでした。誰もがこの問題を解決する方法を知っていますか?

答えて

1

境界線ではありません。あなたはすべての高さ(高さ/ 20)を置いていますが、追加したばかりのボーダーは考慮されていません。これは高さに数えられます。

(高さ/ 20〜4)のように試してください

関連する問題