将按钮设置在“固定”位置。在React Native中 [英] set button in position "fixed" in React Native

查看:1100
本文介绍了将按钮设置在“固定”位置。在React Native中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在React Native的右下角固定位置设置按钮。

I would like set button on the bottom right corner width fixed position in React Native.

位置:固定在React Native中不起作用,并且ScrollView中的 stickyHeaderIndices 方法不允许将元素放置在其他组件上方。

position: fixed don't work in React Native and stickyHeaderIndices method in ScrollView does not allow to position an element above the others component.

有人已经测试过此功能吗?

Anyone have already test this feature ?

推荐答案

尝试一下:

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>
    );
  }

输出:

这篇关于将按钮设置在“固定”位置。在React Native中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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