Open hwcncd opened 1 year ago
import React from 'react';
import {View, StyleSheet, Text} from 'react-native';
import {Tabs} from '@ant-design/react-native';
export default class ApprovalPendingListScreen extends React.Component {
constructor(props) {
super(props);
this.state = {
tabs: [{title: '已发起'}, {title: '待处理'}, {title: '已处理'}],
};
}
render() {
const {tabs} = this.state;
return (
<View style={styles.container}>
<Tabs tabs={tabs}>
<View style={styles.tab}>
<Text>Content of First Tab</Text>
</View>
<View style={styles.tab}>
<Text>Content of Second Tab</Text>
</View>
<View style={styles.tab}>
<Text>Content of Third Tab</Text>
</View>
</Tabs>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'green'
},
tab:{
flex: 1,
backgroundColor: 'black'
},
});
打开app后第一个页面调用tabs才会出现
Reproduction link
Steps to reproduce
android真机调试,关闭app后重新打开,底部有绿色横条
What is expected?
黑色view铺满
What is actually happening?
底部有绿色横条
使用了@react-navigation/bottom-tabs 底部导航,在初始页打开之后底部导航占用过高高度,自适应调整后恢复正常,tabs的高度会刷新,但是里面的view高度少了一截
import React from 'react'; import {View, StyleSheet, Text} from 'react-native'; import {Tabs} from '@ant-design/react-native'; export default class ApprovalPendingListScreen extends React.Component { constructor(props) { super(props); this.state = { tabs: [{title: '已发起'}, {title: '待处理'}, {title: '已处理'}], }; } render() { const {tabs} = this.state; return (
} } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'green' }, tab:{ flex: 1, backgroundColor: 'black'
}, });