reactjs - 如何在本机反应中实现以下设计?
问题描述
有人可以帮我实现与上述相同的设计吗
这是我的代码,请查看!
<TabView>
{Buttons.map((each, i) => {
return(
<ButtonTabView color={each.color}>
<ButtonText color={each.color}>{each.title}</ButtonText>
</ButtonTabView>
)
})}
</TabView>
export const TabView = styled.View`
flexDirection: row;
padding: 10px;
justify-content: space-around;
`;
export const ButtonTabView = styled.TouchableOpacity`
padding: 10px;
border-width: 1px;
border-radius: 8px;
border-color: ${props => props.color};
justify-content: center;
`;
export const ButtonText = styled.Text`
color: ${props => props.color};
font-family: ${Theme.fontFamily.regular};
font-size: ${Theme.fontSize.semiRegular};
`;
我在实现相同设计时遇到问题我在这里缺少任何样式属性吗?
解决方案
你需要更换你的TabView
这里,
export const TabView = styled.View`
flex-direction: row;
flex-wrap: wrap;
padding: 10px;
justify-content: space-around;
`;
推荐阅读
- java - 如何使用同一 jdbc 驱动程序的不同版本设置多个数据源?
- php - PHP preg_replace 填充一个数字
- excel - 如何将包含值和频率的表格转换为 Excel 2016 中的单个列表?
- c++ - 是否有一种优雅而快速的方法来测试整数中的 1 位是否位于连续区域中?
- python-3.x - 使用 pycharm 在 Django 中创建项目
- java - Spring boot H2 db模式oracle
- google-colaboratory - Google colab 自动更改语言
- javascript - 如何将 JSON 文件转换为使用 Google Apps 脚本分隔的新行?
- javascript - 如何从 JS 中选择一个复选框
- javascript - 自动播放时出现音频错误,如何解决?