当前位置: 代码迷 >> 综合 >> absolute绝对定位的元素显示不出来的可能原因
  详细解决方案

absolute绝对定位的元素显示不出来的可能原因

热度:89   发布时间:2024-02-07 23:11:43.0

在父元素position: relative相对定位后

对子元素position: absolute绝对定位,如果没有指定width,会显示空白,当然,如果同时设置left和right,相当于会默认计算一个width,所以也可以正常显示

        <Viewstyle={{position: 'absolute',width: '100%',left: 0,// right: 0,bottom: system.isIphoneX ? screen.iPhoneXBottom : 0,height: 45,}}>