找回密码
 立即注册
相关推荐换一批
  1. GB/T 5252-2020 锗单晶位错密度的测试方法
  2. HG/T 2728-2012 代替 HG/T 2728-1995 橡胶密度的测定 直读法
  3. SN/T 4249-2015 造纸木片水分含量及基本密度测定方法
  4. SN 0045-92 出口石脑油PONA值检验方法利普金双毛细管比重瓶法测定液体的密度和比重
  5. SN/T 0735.6-1997 出口芳香油、单离和合成香料相对密度的测定法
  6. GB/T 23797-2020 病媒生物密度监测方法 蚊虫
  7. SN/T 2383-2017 液体化工品密度和相对密度的测定数字式密度计法
  8. SN/T 1013-2001 进出口棉、涤棉机织物的线密度测定方法
  9. DL/T 785-2001 火力发电厂中温中压管道(件)安全技术导则
  10. HG/T 3835-2006 颜料密度的测定(用离心机排除夹带空气)
  11. GB/T 39500-2020 皮革 物理和机械试验视密度和单位面积质量的测定
  12. DL/T 917-2005 六氟化硫气体密度测定法
  13. DL/T 1988-2019 六氟化硫气体密度测定法U型管振荡法
  14. GB∕T 11062-2020 天然气 发热量、密度、相对密度和沃泊指数的计算方法
  15. GB∕T 39500-2020 皮革 物理和机械试验 视密度和单位面积质量的测定
  16. GB∕T 17651.2-2021 电缆或光缆在特定条件下燃烧的烟密度测定 第2部分:试验程序和?
  17. GB∕T 17651.1-2021 电缆或光缆在特定条件下燃烧的烟密度测定 第1部分:试验装置
  18. JJG 171-2016 液体相对密度天平检定规程
  19. GB 5009.2-2016 食品安全G家标准 食品相对密度的测定
  20. FZ/T 01035-2014 纺织品 标示线密度的通用制(特克斯制)
  21. JB/T 8133.14-2013 电炭制品物理化学性能试验方法 第14部分 体积密度
  22. GB 5413.33-2010 食品安全G家标准 生乳相对密度的测定
  23. FZ/T 70008-2012 毛针织物编织密度系数试验方法
密度densitythe160 | android开发 2022-11-03 146 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阅读器的源码