简体   繁体   中英

React Native Tab View : displaying empty screen when Tabview element is wrapped / nested within View

I am using 'react-native-tab-view' library in my code. Link here: npm / github .

Here is a basic example code in snack - that can run on Web.

Now the issue is- if I want to display a Header text above <Tabview/> tag, it shows nothing. Even if I just wrap the <Tabview/> within a <View></View> like this below snippet, it shows an empty screen, even without any error.

<View>
  <TabView .... />   /*Shows empty screen*/
</View>

Here is an example code screenshot with output, from snack with nested <Tabview/> , running in Android device :

在此处输入图像描述

Kindly suggest how to achieve that. Not sure what am I missing?

I think you should have to use <View style={{flex:1}}> Tab code </View>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM