CSS 在 React Native 的“固定”位置设置按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48188126/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
set button in position "fixed" in React Native
提问by s-leg3ndz
I would like set button on the bottom right corner width fixed position in React Native.
我想在 React Native 的右下角宽度固定位置设置按钮。
position: fixed
don't work in React Native and stickyHeaderIndices
method in ScrollView does not allow to position an element above the others component.
position: fixed
在 React Native 中不起作用,并且stickyHeaderIndices
ScrollView 中的方法不允许将元素定位在其他组件上方。
Anyone have already test this feature ?
有人已经测试过这个功能吗?
回答by Himanshu Dwivedi
回答by Bashirpour
<View style={{flex: 1}}>
<ScrollView style={{backgroundColor:'yellow'}}>
<Text>body</Text>
</ScrollView>
<View><Text>sticky footer</Text></View>
</View>
回答by SLIMANI Mohammed
If you are using Native Base you can just use the Footer Component
如果您使用的是 Native Base,您可以只使用页脚组件
回答by Marco Antonio
Just put the component outside of the scrollview and set it with position absolute
只需将组件放在滚动视图之外并将其设置为绝对位置