Git Product home page Git Product logo

Comments (5)

whataa avatar whataa commented on May 30, 2024

画线范围是相对View区域的,不太理解你的问题

from suitlines.

BolexLiu avatar BolexLiu commented on May 30, 2024

比如我们自定义了一个VIew。要求适配不同的手机上展示等比例绘制画布上的图。 比如画一条线是长度是10。那么在画布中这个10的单位是用的什么来表示呢? 再一个若使用控件时传入了dp作为单位,是否还要考虑到转换单位再绘制的问题。

from suitlines.

whataa avatar whataa commented on May 30, 2024

图肯定是适配了的,你也可以参见源码。例如指定了可见点的数量,不论屏幕多大大小,始终是指定的数量,变化的是两个点之间的间距。另外,对外的接口的参数只有xy轴的文字大小的单位需要是sp,其余的不涉及dp或者sp,因此整体来说,不用担心适配问题。

from suitlines.

BolexLiu avatar BolexLiu commented on May 30, 2024

好的,感谢。照这样理解。是不是除了字体是用了sp,其余的都是px。也就是基于像素来确定单位的?

from suitlines.

whataa avatar whataa commented on May 30, 2024

是的,不过我建议你可以以具体的某个方法为例咨询。

最后感谢你的提问。

from suitlines.

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.