Closed litaoyuan closed 4 years ago
应该是有些高度的地方用了setHeight了吧 ,替换成setWidth试试
Widget oneWidght() {
return Container(
color: Colors.white,
width: double.infinity,
height: ScreenUtils.setHeight(437),
child: Stack(
children:
上下的距离我都用ScreenUtils.setHeight 左右的距离我都用ScreenUtils. setWidth
double.infinity,这个会影响吗?
因为现在手机比例比较多 , 18:9 18:10 啥的 长列表的布局, 如果在上下的适配上用setHeight可能导致不是自己想要的效果 因为这是专门针对高度来做适配的方法, 如无特殊需要 , 可以使用setWidth
也就是说,只能是宽适配,高度随手机适配,大部分都用setWidth
是的 除非是有需求高度上要保持比例, 但一般不用 所以用setWidth没有问题就不用考虑setHeight的方法了
解决了,谢谢
确认是这个问题吗?
是的 这是效果图,有些位置不对,是因为我获取状态栏的高度 iOS 跟android 不一样,所以导致有些适配有点问题
这个是ios的 这个是Android的