[英]Reduce height and vertical padding for a react-native-paper TextInput
[英]React native react-native-paper button with greater height
您可以在按鈕周圍創建一個可觸摸的高亮視圖並調用相同的 onPress function。 像這樣的東西:
<TouchableHighlight onPress={() => console.log('Pressed')}>
<View
style={{
height: 70,
width: 110,
borderRadius: 5,
backgroundColor: 'blue',
alignItems: 'center',
justifyContent: 'center',
}}>
<Button
mode="contained"
labelStyle={{ color: 'blue' }}
onPress={() => console.log('Pressed')}>
Start
</Button>
</View>
</TouchableHighlight>
您可以使用
contentStyle
例子
<Button
onPress={() => {}}
style={styles.completeFormButton}
styleText={styles.completeFormButtonText}
contentStyle={{ // <--- HERE-----
paddingVertical: 10,
}}
preset="outlined"
/>
react-native-papper
有這三個 props 可以通過 styles
contentStyle類型:StyleProp 按鈕內部內容的樣式。 使用此道具應用自定義高度和寬度,並使用 flexDirection: 'row-reverse' 設置右側的圖標。
樣式類型:StyleProp
labelStyle類型:StyleProp 按鈕文本的樣式。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.