【发布时间】:2016-09-16 00:00:05
【问题描述】:
似乎在使用position:absolute 时,无法使用justifyContent 或alignItems 使元素居中。有一个使用marginLeft 的解决方法,但即使使用尺寸来检测设备的高度和宽度,所有设备的显示也不相同。
bottom: {
position: 'absolute',
justifyContent: 'center',
alignItems: 'center',
top: height*0.93,
marginLeft: width*0.18,
},
bottomNav: {
flexDirection: 'row',
},
【问题讨论】:
-
你的元素是静态宽度还是动态宽度?
标签: position react-native flexbox absolute