【发布时间】:2025-12-21 18:50:10
【问题描述】:
我无法解决这个问题。 我构建了一个简单的 UI,并尝试在视图中设置两个组件 一个将占据左侧,另一个占据右侧。 我设法让它工作,在 android 模拟器和 genymotion 模拟器上看起来不错 但是当我使用 expo qr 代码/构建 apk 时,文本和输入会改变位置:
更新:
我尝试了一个更简单的代码,但问题仍然存在:
<View style={{flex:1,backgroundColor:"#fdf",alignItems:"center"}}>
<View style={{flexDirection: 'row',height:100,width:150,backgroundColor:"red"}}>
<View style={{position:"absolute",left:0,width: 50, height: 50, backgroundColor: 'skyblue'}} />
<View style={{position:"absolute",right:0,width: 50, height: 50, backgroundColor: 'steelblue'}} />
</View>
</View>
感谢您的帮助!
【问题讨论】:
标签: react-native components react-native-android expo