找回密码
 立即注册
相关推荐换一批
  1. SN/T 2383-2017 液体化工品密度和相对密度的测定数字式密度计法
  2. SN/T 1013-2001 进出口棉、涤棉机织物的线密度测定方法
  3. DL/T 785-2001 火力发电厂中温中压管道(件)安全技术导则
  4. HG/T 3835-2006 颜料密度的测定(用离心机排除夹带空气)
  5. GB/T 39500-2020 皮革 物理和机械试验视密度和单位面积质量的测定
  6. DL/T 917-2005 六氟化硫气体密度测定法
  7. DL/T 1988-2019 六氟化硫气体密度测定法U型管振荡法
  8. GB∕T 11062-2020 天然气 发热量、密度、相对密度和沃泊指数的计算方法
  9. GB∕T 39500-2020 皮革 物理和机械试验 视密度和单位面积质量的测定
  10. GB∕T 17651.2-2021 电缆或光缆在特定条件下燃烧的烟密度测定 第2部分:试验程序和?
  11. GB∕T 17651.1-2021 电缆或光缆在特定条件下燃烧的烟密度测定 第1部分:试验装置
  12. JJG 171-2016 液体相对密度天平检定规程
  13. GB 5009.2-2016 食品安全G家标准 食品相对密度的测定
  14. FZ/T 01035-2014 纺织品 标示线密度的通用制(特克斯制)
  15. JB/T 8133.14-2013 电炭制品物理化学性能试验方法 第14部分 体积密度
  16. GB 5413.33-2010 食品安全G家标准 生乳相对密度的测定
  17. FZ/T 70008-2012 毛针织物编织密度系数试验方法
  18. SN/T 0801.8-2010 进出口动植物油脂密度检验方法
  19. NB/SH/T 0817-2010 半固体和固体沥青密度的测定 镍坩埚法
  20. JC/T 685-2009 摩擦材料密度试验方法
  21. YS/T 256-2009 氧化钴
  22. GB/T 24586-2009 铁矿石 表观密度、真密度和孔隙率的测定
  23. FZ 70002-1991 针织物线圈密度测量法
  24. GB/T 2281-2008 焦化油类产品密度试验方法
密度densitythe160 | android开发 2022-11-03 151 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阅读器的源码