如何将React Native Button放置在屏幕底部以在多个ios设备上工作 [英] How to Position a React Native Button at the bottom of my screen to work on multiple ios devices

查看:80
本文介绍了如何将React Native Button放置在屏幕底部以在多个ios设备上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很年轻,想在本机搜索网络上寻找可以帮助我解决此问题但没有任何帮助的教程.我知道如何将屏幕上的按钮从A点移动到B点.问题是,我似乎无法将其固定在底部,以在我的ios仿真器的不同外形尺寸上工作. 到目前为止,我已经尝试使用marginTop将按钮按下到屏幕上,但是一旦我将仿真器更改为其他屏幕尺寸,按钮就会稍微增大一点.我问我是否可以获得任何指导,因为我如何将其设置为在不同的ios屏幕上工作.

I am young to react native search the web for tutorials that could help me with this problem but have not find anything. I know how to move the buttons from point A to B on my screen. The thing is I just cant seem to get it to be fixed at the bottom to work on different form factors of my ios emulator. So far I have tried marginTop which takes down the button to the screen but as soon as a I change the emulator to a different screen size the button goes up a little. I am asking can I get any guidance as how I may set this to work on different ios screens.

  submitButton: {
    height: 85,
    flex: 1,
    backgroundColor: "#FFBB34",
    borderColor: "#555555",
    borderWidth: 0,
    borderRadius: 0,
    marginTop: 200,
    justifyContent: "flex-start"
}

上面的代码是我的按钮.

The code above is my button.

推荐答案

您可以使用绝对位置将内容放置在所需的位置...

You can use absolute position to put things wherever you want...

submitButton: {
    position: 'absolute',
    bottom:0,
    left:0,
}

将放在屏幕底部左侧....

will put at bottom of screen, left side....

这篇关于如何将React Native Button放置在屏幕底部以在多个ios设备上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆