Skip to content

Commit 1558985

Browse files
committed
chore(Input,Stepper,SpeedDial): Android 文字没有居中, Android 没有显示问题
1 parent 200363a commit 1558985

File tree

4 files changed

+31
-25
lines changed

4 files changed

+31
-25
lines changed

example/examples/src/routes/SpeedDial/index.tsx

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React, {Component} from 'react';
2-
import {StyleSheet, View, Text} from 'react-native';
2+
import {StyleSheet, View, Text, Dimensions} from 'react-native';
33
import Layout, {Container} from '../../Layout';
44
import {SpeedDial, Icon, IconsName} from '@uiw/react-native';
55
import {ComProps} from '../../routes';
66

7+
let MainHeight = Dimensions.get('window').height;
8+
79
const {Header, Body, Card, Footer} = Layout;
810

911
export interface listItem {
@@ -32,29 +34,32 @@ export default class Index extends Component<IndexProps, IndexState> {
3234
<Layout>
3335
<Header title={title} description={description} />
3436
<Body scrollEnabled={false}>
35-
<SpeedDial
36-
icon={['star-on', 'star-off']}
37-
isDrag={true}
38-
children={[
39-
{
40-
icon: <Icon name="plus" color="#fff" size={18} />,
41-
title: <Text>'Add'</Text>,
42-
onPress: () => console.log('Add'),
43-
},
44-
{
45-
icon: <Icon name="star-on" color="#fff" size={18} />,
46-
title: 'Star',
47-
},
48-
{
49-
icon: <Icon name="mail" color="#fff" size={18} />,
50-
title: 'Mail-asdlfslasdkfsdklajfsadf',
51-
},
52-
{
53-
icon: <Icon name="share" color="#fff" size={18} />,
54-
title: 'Share',
55-
},
56-
]}
57-
/>
37+
<View style={{height: MainHeight}}>
38+
<SpeedDial
39+
bottom={MainHeight / 2 + 100}
40+
icon={['star-on', 'star-off']}
41+
isDrag={true}
42+
children={[
43+
{
44+
icon: <Icon name="plus" color="#fff" size={18} />,
45+
title: <Text>'Add'</Text>,
46+
onPress: () => console.log('Add'),
47+
},
48+
{
49+
icon: <Icon name="star-on" color="#fff" size={18} />,
50+
title: 'Star',
51+
},
52+
{
53+
icon: <Icon name="mail" color="#fff" size={18} />,
54+
title: 'Mail-asdlfslasdkfsdklajfsadf',
55+
},
56+
{
57+
icon: <Icon name="share" color="#fff" size={18} />,
58+
title: 'Share',
59+
},
60+
]}
61+
/>
62+
</View>
5863
</Body>
5964
<Footer />
6065
</Layout>

packages/core/src/Input/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export default class Input extends React.Component<InputProps, any> {
150150
{...restProps}
151151
{...valueProps}
152152
style={[
153+
{ paddingVertical: 0 },
153154
inputStyles.input,
154155
error ? inputStyles.inputErrorColor : null,
155156
disabledStyle,

packages/core/src/SpeedDial/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental
1919
UIManager.setLayoutAnimationEnabledExperimental(true);
2020
}
2121

22-
let MainWidth = Dimensions.get('window').width;
2322
let MainHeight = Dimensions.get('window').height;
2423

2524
export interface PanXY extends Animated.Value {

packages/core/src/Stepper/ShowValue.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function ShowValue(props: ShowValueProps) {
4949
ControlStyle[size],
5050
styles.border,
5151
{
52+
paddingVertical: 0,
5253
fontSize: ControlStyle[`${size}Text`].fontSize - 8,
5354
textAlign: 'center',
5455
borderColor: color.borderColor || color.color,

0 commit comments

Comments
 (0)