Code Monkey home page Code Monkey logo

Comments (5)

lizhuoyuan avatar lizhuoyuan commented on July 20, 2024

大小的话会按照屏幕分辨率进行不同程度的放大/缩小
但是如果是说图片所在位置有改变的话 可能是其他问题

from flutter_screenutil.

cixiu avatar cixiu commented on July 20, 2024

我遇到的是,有2个手机,分辨率分辨是1080x1920, 另一个是1080x2280。pixelRatio都等于3,这就导致通过setWidth 和 setHeight设置宽度后,宽是一致,但是不同手机计算出来的高度不一致,所以图片的显示区域也就不一致了。所以有没有实现微信小程序的 rpx 实现方式呢。

from flutter_screenutil.

lizhuoyuan avatar lizhuoyuan commented on July 20, 2024

你可以都使用setWidth来设置宽和高

from flutter_screenutil.

cixiu avatar cixiu commented on July 20, 2024

是的,确实可以都使用 setWidth 来设置宽高,不过 setWidth 和 setHeight 这2个命名会造成歧义。setWidth 和 setHeight 本身都是返回一个 double,一个是根据 MediaQuery.of(context).size.width 返回一个double,一个是根据 MediaQuery.of(context).size.height 返回一个 double。所以使用setWidth和setHeight的命名并不是字面的设置宽和设置高的意思。

from flutter_screenutil.

lizhuoyuan avatar lizhuoyuan commented on July 20, 2024

是有点歧义 , 但我文档里有说......

from flutter_screenutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.