feat: 级联选择样式优化
This commit is contained in:
parent
6bc7d8b362
commit
ddf37c26e9
@ -123,8 +123,14 @@ const CascaderComponent: React.FC<CascaderProps> = ({
|
|||||||
{ borderRightColor: dividerColor }
|
{ borderRightColor: dividerColor }
|
||||||
]
|
]
|
||||||
]}
|
]}
|
||||||
|
>
|
||||||
|
<ScrollView
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
showsVerticalScrollIndicator={true}
|
||||||
|
contentContainerStyle={{ paddingBottom: 20 }}
|
||||||
>
|
>
|
||||||
{renderLevel(items, level)}
|
{renderLevel(items, level)}
|
||||||
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
@ -143,6 +149,7 @@ const CascaderComponent: React.FC<CascaderProps> = ({
|
|||||||
horizontal
|
horizontal
|
||||||
showsHorizontalScrollIndicator={false}
|
showsHorizontalScrollIndicator={false}
|
||||||
contentContainerStyle={styles.scrollContent}
|
contentContainerStyle={styles.scrollContent}
|
||||||
|
style={{ flex: 1 }}
|
||||||
>
|
>
|
||||||
{renderColumns()}
|
{renderColumns()}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
@ -159,18 +166,22 @@ const styles = StyleSheet.create({
|
|||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
|
height: 300, // Set a fixed height for the container
|
||||||
},
|
},
|
||||||
scrollContent: {
|
scrollContent: {
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
|
height: '100%',
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
height: '100%',
|
height: '100%',
|
||||||
|
maxHeight: '100%',
|
||||||
},
|
},
|
||||||
columnWithDivider: {
|
columnWithDivider: {
|
||||||
borderRightWidth: 1,
|
borderRightWidth: 1,
|
||||||
},
|
},
|
||||||
levelContainer: {
|
levelContainer: {
|
||||||
height: '100%',
|
height: '100%',
|
||||||
|
maxHeight: '100%',
|
||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@ -178,8 +189,8 @@ const styles = StyleSheet.create({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
paddingVertical: 12,
|
paddingVertical: 12,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
minWidth: '100%', // 确保最小宽度填满容器
|
minWidth: '100%',
|
||||||
overflow: 'hidden', // 隐藏超出部分
|
overflow: 'hidden',
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user