![](/img/trans.png)
[英]How to use scrollable-tab-view with react-native-router-flux
[英]react native text box above scrollable-tab-view
新增功能以響應本機,嘗試將文本框放在可滾動的標簽視圖上方
export default React.createClass({
render() {
return
<View>
<TextInput
style={{height: 50}}
placeholder="Enter!"
onChangeText={(searchText) => this.setState({searchText})}/>
<ScrollableTabView
style={{marginTop: 10, }}
initialPage={1}
renderTabBar={() => <FacebookTabBar />}
>
<ScrollView tabLabel="ios-search" style={styles.tabView}>
<View style={styles.card}>
<TextInput
style={{height: 50}}
placeholder="Enter!"
onChangeText={(searchText) => this.setState({searchText})}/>
</View>
</ScrollView>
</ScrollableTabView>
</View>
;
},
});
滾動標簽視圖沒有顯示以上代碼,我無法理解原因,請咨詢。 我正在嘗試制作類似Linkedin應用程序的東西。
<ScrollableTabView>
的樣式為flex: 1
,因此您需要像這樣將flex: 1
顯式設置為其上級,以顯示它:
return (
<View style={{flex: 1}}>
...
</View>
);
這是React Native 文檔中有關Flex的引用:
如果組件的父級尺寸大於0,則只能展開以填充可用空間。如果父級的寬度和高度或彈性都沒有固定值,則父級的尺寸將為0,而flex子級將不可見。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.