NativeBase:如何在 Toast 中居中放置文本?
NativeBase: How center text inside of Toast?
NativeBase 的 Toast 标签显示的文本默认位置在左侧:
问题:如何将 "cache cleared" 文本居中?
所有这些尝试都未能产生所需的居中:
Toast.show
style: justifyContent: 'center', alignItems: 'center', alignSelf: 'center'
text: 'cache cleared'
textStyle: justifyContent: 'center', alignItems: 'center', alignSelf: 'center'
(咖啡脚本)
这就是你的做法
Toast.show({
text: 'Some text',
position: 'bottom',
type: 'danger',
duration: 1000,
textStyle: {
textAlign: 'center'
}
})
NativeBase 的 Toast 标签显示的文本默认位置在左侧:
问题:如何将 "cache cleared" 文本居中?
所有这些尝试都未能产生所需的居中:
Toast.show
style: justifyContent: 'center', alignItems: 'center', alignSelf: 'center'
text: 'cache cleared'
textStyle: justifyContent: 'center', alignItems: 'center', alignSelf: 'center'
(咖啡脚本)
这就是你的做法
Toast.show({
text: 'Some text',
position: 'bottom',
type: 'danger',
duration: 1000,
textStyle: {
textAlign: 'center'
}
})