【发布时间】:2022-01-24 01:18:11
【问题描述】:
今天我尝试进行如下所示的设计! Image
但最后我设法做到了 50%。无法将最右边的按钮放在 View 的末尾。所以到目前为止我的代码 -
const data = [
{
title: "Introduction\n06:25/17:45",
},
{
title: "What is Design Thinking\n00:00 / 12:50",
},
{
title: "What is UX Design?\n00:00/09:32",
},
];
...
const buttonStyle = {
flex: 1,
alignItems: "center",
marginLeft: 15,
marginRight: 15,
flexDirection: "row",
height: 57,
borderRadius: 10,
backgroundColor: "#fff",
marginTop: "5%",
shadowColor: "#000",
shadowOffset: {
width: 0,
height: 6,
},
shadowOpacity: 0.39,
shadowRadius: 8.3,
elevation: 13,
};
<ScrollView
style={{
flex: 1,
width: "100%",
paddingTop: 20,
}}
>
{data.map((item, index) => {
return (
<View style={buttonStyle} key={index}>
<Image
source={require("./assets/play.png")}
style={{ height: 32, width: 32, marginLeft: "5%" }}
/>
<Text
style={{
color: "#b5b3c2",
marginLeft: 15,
textAlign: "left",
}}
>
{item.title}
</Text>
<Image
source={require("./assets/fail.png")}
style={{
height: 32,
width: 32,
justifyContent: "flex-end",
}}
/>
</View>
);
})}
</ScrollView>
如您所见,最右边的图片不在正确的位置?我不知道如何解决它?对不起我的英语不好!另外页面隐藏了我的ScrollView的一部分!
【问题讨论】: