2016-09-21 65 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