【发布时间】:2021-10-26 15:45:46
【问题描述】:
我有一个按钮,其标题非常适合我的手机,但我收到了其他字体较大的人提出的一些问题,由于按钮背景太小,文本被裁剪。
我以为这是因为我在文字中使用了宽度和高度,所以我将其更改为百分比,但错误仍然存在。 如何调整按钮大小以在任何设备上正确保存文本?
这是我的按钮
button: {
backgroundColor: blue,
justifyContent: 'center',
padding: 9,
borderRadius: 5,
marginTop: 10,
width: '40%',
height: '10%',
},
这就是我使用它的方式
<View style={styles.button}>
<Ionicons.Button
name="alarm"
size={20}
color="white"
onPress={showTimepicker}
backgroundColor={'transparent'}>
<Text style={styles.notifsText}>Definir horario de Notificaciones</Text>
</Ionicons.Button>
</View>
【问题讨论】:
标签: javascript android react-native mobile expo