sách gpt4 ai đã đi

react-native - 我想要 2 个按钮并排 react 原生

In lại 作者:行者123 更新时间:2023-12-03 18:14:10 hai mươi bốn 4
mua khóa gpt4 Nike

我是 native react 的新手,我正在尝试并排实现 2 个按钮我已经尝试过但我无法实现它,因为我已经插入了 2 个按钮它出现在另一个下面

Đây là mã của tôi:

      
<>
title={"Pause"}
style={styles.buttonStyle}
onPress={() => {
this.setState({ paused: true });
}}
color="#841584"
/>


<>
title={"Play"}
onPress={() => {
this.setState({ paused: false });
}}
color="green"
/>


);
}
}
const styles = StyleSheet.create({
backgroundVideo: {
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0
},
buttonStyle: {
marginHorizontal: 20,
marginTop: 5
}
});
export default VideoPlayer;

1 Câu trả lời

定义渲染方向的属性称为 flexDirection,它可以设置为列(默认,垂直渲染项目)或行(水平渲染项目)。

因此,要达到所需的效果,您需要将样式属性 flexDirection:"row"添加到包含按钮的 View 中。您的代码如下所示:









关于react-native - 我想要 2 个按钮并排 react 原生,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55222627/

hai mươi bốn 4 0
行者123
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com