我很年轻,在网上搜索教程,可以帮助我解决这个问题,但没有找到任何东西。我知道如何在我的屏幕上移动按钮从A点到B点。问题是,我似乎不能让它固定在底部,以工作在我的ios模拟器的不同形式因素。到目前为止,我已经尝试了marginTop,它可以将按钮降到屏幕上,但只要我将模拟器更改为不同的屏幕大小,按钮就会上升一点。我问我能得到任何指导,因为我可以如何设置这在不同的ios屏幕上工作。
submitButton: {
height: 85,
flex: 1,
backgroundColor: "#FFBB34",
borderColor: "#555555",
borderWidth: 0,
borderRadius: 0,
marginTop: 200,
justifyContent: "flex-start"
}
上面的代码是我的按钮。
4条答案
按热度按时间hiz5n14c1#
你可以使用绝对位置把东西放在你想放的地方...
将放置在屏幕底部,左侧....
wz8daaqr2#
下面是我如何将浮动按钮放置在屏幕的右下角。
对容器按钮使用以下样式(& B):
输出量:
92vpleto3#
您可以在https://facebook.github.io/react-native/docs/flexbox.html处尝试下面的代码,直到该链接不再起作用。
基本上你把屏幕分成3部分,顶部可滚动,底部可滚动。下面的代码只是为了简单起见做了3个视图(没有滚动,只是用ScrollView替换中间的一个,以获得更有用的东西。
gg0vcinb4#
所述元件
CSS
希望这段代码能帮助你解决问题,不要忘了使用尺寸来设置身高和体重,但是可以选择使用尺寸