我在另一个ScrollView
中有一个ScrollView
。我注意到,为了使嵌套的滚动视图开始滚动,我必须点击两次。
我尝试使用一些属性,如scrollenabled
、nestedscrollenabled
和keyboardshouldpersisttaps=“always”
,但这些都没有帮助。
我不能提供任何真实的代码,因为项目相当大,在滚动视图之间有多个组件。但是,基本结构与此类似:
<ScrollView>
<SomeNestedComponents>
<ScrollView
scrollEnabled={true}
nestedScrollEnabled={true}
keyboardShouldPersistTaps="always"
>
</ScrollView>
</SomeNestedComponents>
</ScrollView>
我建议您也尝试将keyboardshouldpersisttaps='always'
放在最外面的
组件上。根据这期GitHub的最终答案,这应该可以解决问题。
例如:
<ScrollView keyboardShouldPersistTaps='always'>
<SomeNestedComponents>
<ScrollView
scrollEnabled={true}
nestedScrollEnabled={true}
keyboardShouldPersistTaps='always'
>
</ScrollView>
</SomeNestedComponents>
</ScrollView>