750rpx 不能适配所有屏幕,只有 375 宽度的屏幕适配

小程序 文章 2021-12-13 16:00 1047 0 全屏看文

AI助手支持GPT4.0

750rpx 不能适配所有屏幕,只有 375 宽度的屏幕适配750rpx can’t fit all screens, only 375 width screen fits

750rpx 不能适配所有屏幕,只有 375 宽度的屏幕适配
框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 微信安卓客户端 7.0.20 2.19.3

这图是我在 375 的设备下开发的,看起来挺正常,上面哪些省份简称用的是 flex 布局,然后 x 使用的是固定定位,flex 内容两边留 30rpx 的宽度,绝对定位定位 30rpx 的距离,成立。

一旦换成非 375 的设备显示就出现了这种问题了,明显我这两边留空不一致,很显然,屏幕全宽 750rpx 并不适配,同时我也使用真机测试了一下,使用的是小米10,结果显示也为上面这种,并不对齐。

Framework type problem type terminal type wechat version basic library version applet bug wechat Android client 7.0 20 2.19. 3 this figure is developed by me under the 375 device. It looks quite normal. Which provinces above use the flex layout for short, and then x use the fixed positioning. The width of 30rpx is reserved on both sides of the flex content, and the absolute positioning distance of 30rpx is established. This problem occurs once the display is changed to a non-375 device. Obviously, the gaps on both sides are inconsistent. Obviously, the full width of the screen 750rpx does not fit. At the same time, I also tested it with a real machine. I used Xiaomi 10, and the result is the same as the above, which is not aligned.

回答:

武曲心:

60+10*x+9*y=750,x是字宽,y是间距,设置box-sizing:border-box,y取10,x就是60,这么算写死也是可以的

ㅤ:

flex没用好

微喵网络:

上代码片段

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
举报该外卖小程序,没有外卖资质,是怎么审核通过的?涉及高校学生个人信息及食品安全问题请严查!
今天怎么发送订阅消息一直提示accessToken过期
微信认证怎么通过对公打款支付300元认证费?
微信开发平台 修改APP图标后 并没有更改?
支付平台里的“企业付款到零钱”和“分账”的区别是啥?
随便看看
教育科技公司申请微信支付被拒绝? 3899
微信公众号免300认证教程 5000
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 4119
小程序广告组件通过审核,但是小程序内没有显示广告? 4297
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8083
问题? 7408
如何快速搭建抽奖助手小程序(无需代码知识) 5091
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6044
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5656
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5248