反应本机下拉位置 [英] react-native dropdown position

查看:69
本文介绍了反应本机下拉位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的下拉菜单位于屏幕底部附近,如何防止该下拉菜单在打开时离开屏幕?目前,如果我有多个选择,则下拉菜单将不显示在屏幕上.如何制作它,使其知道它在底部附近,并且将向上打开或移动到比屏幕底部更高的位置?

If I have a dropdown that is near the bottom of the screen, how do I prevent the dropdown from leaving the screen when it is opened? Currently if I have more than a few options, the dropdown container goes off the screen. How do I make it so it knows that it is near the bottom and will open upward or will move higher than the bottom of the screen?

推荐答案

将top和z-index赋予下拉列表,如.....

give top and z-index to dropdown like .....

<Dropdown
                    label='Program Type'
                    containerStyle={{width:140,zIndex:60,
                        top:20,}}
                    fontSize={16}
                    baseColor={"#0000ff"}
                    data={dropBoxData}
                    onChangeText={this.onChangeText}>
                </Dropdown>

这篇关于反应本机下拉位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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