Skip to content

Commit 57f5fb6

Browse files
committed
fix: 缩小picker的scale,并配置文字的超出效果
1 parent b1257f7 commit 57f5fb6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.changeset/lemon-tomatoes-peel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@td-design/react-native-picker': patch
3+
---
4+
5+
fix: 缩小picker的scale,并配置文字的超出效果

packages/react-native-picker/src/components/WheelPicker/WheelPickerItem.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function WheelPickerItem({ textStyle, style, visibleRest, height, option, index,
2323
opacityOutputRange.push(y);
2424
}
2525

26-
const scaleOutputRange = [1.3];
26+
const scaleOutputRange = [1.1];
2727
for (let x = 1; x <= visibleRest + 1; x++) {
2828
const y = scaleFunction(x);
2929
scaleOutputRange.unshift(y);
@@ -52,7 +52,9 @@ function WheelPickerItem({ textStyle, style, visibleRest, height, option, index,
5252

5353
return (
5454
<Animated.View style={[styles.option, style, { opacity, transform: [{ rotateX }, { scale }] }]}>
55-
<Animated.Text style={textStyle}>{option?.label}</Animated.Text>
55+
<Animated.Text style={textStyle} numberOfLines={1} ellipsizeMode={'tail'}>
56+
{option?.label}
57+
</Animated.Text>
5658
</Animated.View>
5759
);
5860
}

0 commit comments

Comments
 (0)