【问题标题】:Scrollview goes under status bar when using KeyboardAvoidingView使用 KeyboardAvoidingView 时,滚动视图位于状态栏下方
【发布时间】:2019-01-25 23:39:29
【问题描述】:

如果你看一下状态栏左边的时间,你可以看到部分滚动视图显示。向上滚动时,我可以看到所有元素(选择器、文本输入等)在状态栏下方滚动的滚动视图。

我的层次结构是这样的

        <React.Fragment>
          <SafeAreaView forceInset={true} style={{ flex: 1, backgroundColor: colors.black, zIndex: 10000 }}>

           <View style={{flex:1}}>
           <Header/> //has certain height. had to add zIndex=10000 to avoid same issue
             <KeyboardAvoidingView behavior='position'>
               <ScrollViewWithContent/>
             </KeyboardAvoidingView>
           </View>

          </SafeAreaView>
        </React.Fragment>

你看到什么明显的不对了吗?

【问题讨论】:

    标签: react-native scrollview


    【解决方案1】:

    添加overflow:hidden; 就可以了。但是我觉得这不应该首先发生。最初的错误是一种奇怪的状态,滚动视图的一部分显示(文本)而部分不显示(背景)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多