2016-09-21 64 views
1

我搜索了很多,但我確實發現如何給z-index屬性的反應原生,如果我使用zIndex反應原生它顯示我錯誤,這是無效的樣式道具類型。如何給z-index屬性反應原生android應用程序

這裏是我的渲染代碼。正如你可以在下面看到的,我想讓autoContainer視圖可見。所以請告訴我如何在不使用任何第三方庫的情況下將其放在前面。

render() { 
    return (
     <View style={{flex:1}}> 
     <View style={[styles.inputWrap,this.props.error]}> 
     <TextInput 
      style={[style.input,this.props.style]} 
      ref={this.props.name} 
      onChangeText={(text) =>this.searchItem(this.props.options,text)} 
      value={this.state.value} 
      placeholder={this.props.placeholder} 
      placeholderTextColor="#000000" 
      keyboardType={this.props.keyboard} 
      /> 
     </View> 
     {this.toggleAuto()} 
     </View> 
    ) 
} 
toggleAuto() 
    { 
    if(this.state.autoList!='') 
     { 
    return (<View style={style.autoContainer}> 
      {this.renderList(this.state.autoList)} 
      </View> 
     ); 
     } 
    } 
const style = StyleSheet.create({ 
    input:{ 
    flex:1, 
    height:50, 
    fontSize:16, 
    backgroundColor:'#ffffff', 
    paddingLeft:10, 
    }, 
    autoContainer: { 
    borderTopColor:"#888888", 
    borderTopWidth:1, 
    position:"absolute", 
    right:0, 
    left:0 
    }, 
    list: { 
    backgroundColor:'#f2f2f2', 
    padding:10, 
    borderColor:'#888888', 
    borderBottomWidth:1, 
    borderLeftWidth:1, 
    borderRightWidth:1 
    } 
}); 

回答

5

更新答案zIndex現在ReactNative工作。

你試過elevation style property?

autoContainer: { 
    ..., 
    elevation: 3, 
} 

結帳以下鏈接:

  1. View

  2. Elevation

+0

我試圖擡高,但給我的海拔是onPress不工作後。 – Harinder88

+0

使波紋管所有其他視圖 –

+0

該視圖(具有高程)我是否會呈現在年底這一觀點那麼它的索引將被變了樣,如果你有 1.電子郵件 2.用戶名 3.姓名 4.姓氏 假設我想要名字zIndex,所以如果我將它渲染下面它的問題,請給我一個例子,所以我可以實現它。謝謝 Shukarullah Shah – Harinder88