我在我的RN應用程序中有一個工具欄。該工具欄有一個特意超大的按鈕,並且從該組件溢出。
超大按鈕由同一頁面中的其他組件覆蓋。
絕對位置的元素被其他組件切斷
touchable:{
backgroundColor:'#3d3d3d',
borderRadius:27.5,
position:'absolute',
left:width/2 -25,
bottom:10,
alignItems:'center',
borderColor:'black',
width:55,
height:55,
justifyContent:'center',
}
標記:
render() {
return (
<View style={{flex: 1}}>
<View style={{position:'absolute', width:42,height:42,left:20,top:(height-42)/3,zIndex:3}}>
<Image style={{}} source={require('./Images/Ellipse 36.png')} />
<Image style={{position:'absolute',top:14,left:14}} source={require('./Images/Asset 65.png')} />
</View>
<View style={{position:'absolute', width:42,height:42,right:20,top:(height-42)/3,zIndex:3}}>
<Image style={{}} source={require('./Images/Ellipse 36.png')} />
<Image style={{position:'absolute',top:10,left:12}} source={require('./Images/Asset 66.png')} />
</View>
<View><TopToolbar text='Swipe' navigator={this.props.navigator} user={this.props.user}/></View>
<ScrollView style={{zIndex:1,}}><Inders style={{flex: 1}} navigator={this.props.navigator} credentials={this.props.credentials}/></ScrollView>
<View style={{zIndex:0,}}><BottomToolbar user={this.props.user} navigator={this.props.navigator} credentials={this.props.credentials}/></View>
</View>
)
}
凡Inders是一個組件。
我試着改變組件的順序,但沒有奏效。
使按鈕從另一個組件「浮動」的方法是什麼?
您可以發佈您的React Native代碼示例。風格可能與它無關。 – powerc9000
代碼的哪些部分可以幫助?該加價了嗎? –
https://facebook.github.io/react-native/docs/layout-props.html#zindex –