找回密码
 立即注册
相关推荐换一批
  1. GB/T 11385-1989 信息处理 数据交换用200mm改进调频制记录的位密度为13262磁通翻转/
  2. GB/T 13531.4-1995 化妆品通用检验方法 相对密度的测定
  3. GB/T 13477.2-2002 建筑密封材料试验方法 第2部分: 密度的测定
  4. GB/T 13354-1992 液态胶粘剂密度的测定方法 重量杯法
  5. GB 11116-1989 高密度聚乙烯树脂
  6. GB 11115-1989 低密度聚乙烯树脂
  7. GB/T 13216.5-1991 甘油试验方法 20℃时密度的测定
  8. GB/T 7379-2003 表面活性剂 浆状物在灌装时表观密度的测定
  9. GB/T 6343-1995 泡沫塑料和橡胶 表观(体积)密度的测定
  10. GB/T 6286-1986 分子筛堆积密度测定方法
  11. GB 6156-1985 炭素材料真气孔率测定方法
  12. GB/T 6155-1985 炭素材料真密度测定方法
  13. GB/T 6100-1985 棉纤维线密度试验方法 中段称重法
  14. GB/T 2281-1996 焦化轻油类产品密度试验方法
  15. GB/T 2013-1980 苯类产品密度测定法
  16. GB/T 1713-1989 颜料密度的测定 比重瓶法
  17. GB/T 1464-1987 非金属夹层结构或芯子密度试验方法
  18. GB/T 1463-1988 纤维增强塑料密度和相对密度试验方法
  19. SY/T 6579-2003 密度测井仪校准方法
  20. QB/T 1930-1993 给水用低密度聚乙烯(LDPE, LLDPE)管材
  21. GB/T 17960-2000 信息技术 数据交换用90mm改进调频制记录的位密度为31 831磁通翻转/
  22. GB/T 17686-1999 棉纤维 线密度试验方法 排列法
  23. 中山大学附属小学2016-2017学年度一年级英语上学期期末学业水平测试卷
  24. 2013年新派英语一年级下册期末综合测试卷(含听力材料与参考答案)
密度densitythe160 | android开发 2022-11-03 169 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
Android中的长度单位详解(dp、sp、px、in、pt、mm)看到有很多人不太理解dp、sp和px的区别:现在这儿介绍一下dp和sp。dp也就是dip。这个和sp基本类似。假如设置表示长度、高度等属性时可以使用dp或sp。但假如设置字体,需求使用sp。dp是与密度无关,sp除了与密度无关外,还与scale无关。假如屏幕密度为160,这时dp和sp和px是相同的。1dp=1sp=1px,但假如使用px作单位,假如屏幕大小不变(假设仍是3.2寸),而屏幕密度变成了320。那么本来TextView的宽度设成160px,在密度为320的3.2寸屏幕里看要比在密度为160的3.2寸屏幕上看短了一半。但假如设置成160dp或160sp的话。系统会自动将width属性值设置成320px的。也就是160
320/160。其间320/160可称为密度份额因子。也就是说,假如使用dp和sp,系统会依据屏幕密度的变化自动进行转换。

(In the details of length units in Android (dp, sp, px, in, pt, mm), we can see that many people do not understand the difference between dp, sp and px. Now let's introduce dp and sp. Dp is also called dip. This is basically similar to sp. If you can use dp or sp when setting attributes such as length and height. But if you set the font, you need to use sp. Dp is density independent, sp is not only density independent, but also scale independent. If the screen density is 160, then dp, sp and px are the same. 1dp=1sp=1px, but if you use px as the unit, if the screen size remains unchanged (assuming it is still 3.2 inches), the screen density becomes 320. Then the width of TextView is originally set to 160px, which is half shorter on a 3.2 inch screen with a density of 320 than on a 3.2 inch screen with a density of 160. But if it is set to 160dp or 160sp. The system will automatically set the width attribute value to 320px. That is 160
320/160。 320/160 can be called density share factor. That is, if you use dp and sp, the system will automatically convert according to the change of screen density.)

[下载]09341375052.rar




上一篇:android常用的系统调用
下一篇:Android RSS阅读器的源码