ios - 使用 flexWrap 在按钮末尾换行时遇到困难
问题描述
嗨:我目前正试图让我的文本在到达按钮末尾或代码中的 textWrapper 时换行。我一直在尝试很多不同的 flexWrap:'wrap" 和 flex:1 组合。下面是我所拥有的:
const OptionButton = (props) => {
let styles = StyleSheet.create({
textWrapper: {
flexWrap: 'wrap',
borderWidth: 1,
borderStyle: 'solid',
borderColor: '#000',
borderWidth: 0,
padding: 12,
marginVertical: 8,
backgroundColor: props.isActive ? '#6E6CF0' : '#fff',
width: Dimensions.get('window').width - 40,
height: 60,
justifyContent:'center',
borderRadius: 10,
},
descriptionPadding:{
paddingLeft: 26,
},
inActiveTextColor: {
color:'gray'
},
description:{
flexWrap: 'wrap'
}
});
return (
<View>
<TouchableWithoutFeedback onPress={props.onClick}>
<View style={[styles.textWrapper, props.style]}>
<View style={styles.description}>
<Text style={props.isActive ? [styles.activeTextColor, styles.descriptionPadding] : [styles.normal, styles.descriptionPadding]}>{props.description}</Text>
</View>
</View>
</TouchableWithoutFeedback>
</View>
)
}
目前,我的描述正在按照我的预期进行包装。任何建议都会受到欢迎!
解决方案
推荐阅读
- websocket - 将 NestJS 连接到 websocket 服务器
- android - 在 Google Play 商店上发布应用程序的问题
- powershell - 当 Powershell 通过 *.bat 文件启动时,导致脚本锁定的浏览器窗口
- r - 如何使用 rename() 输入“-”
- flutter - '响应的实例
'颤动Api消费 - angular - Angular 9 cdk 虚拟滚动 - 即使用户滚动,滚动索引也不会改变
- git - 如何在 Git 中获取一组文件的所有作者?
- webhooks - 将已部署智能合约的事件链接到 webhook
- html - 在 Angular 8 中获取表单提交的表单值
- r - 在 R 中跨多列过滤行