我想在 React Native 中的右下角宽度固定位置设置按钮。
position: fixed
在 React Native 中不起作用,并且 ScrollView 中的 stickyHeaderIndices
方法不允许将元素定位在其他组件之上。
有人已经测试过这个功能吗?
最佳答案
试试这个:
render() {
return (
<View style={{flex:1}}>
<View style={{borderWidth:1,position:'absolute',bottom:0,alignSelf:'flex-end'}}>
<Button
title="Press"
color="#841584"
accessibilityLabel="Press"/>
</View>
</View>
);
}
输出:
关于css - 在 React Native 中将按钮设置在位置 "fixed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48188126/