找回密码
 立即注册
相关推荐换一批
  1. 易语言 物理公式支持库 1.0 版
  2. QB/T 3803-1999 喷灌用低密度聚乙烯管材
  3. QB/T 1930-2006 给水用低密度聚乙烯管材
  4. QB/T 1642-2012 陶瓷坯体显气孔率、体积密度测试方法
  5. QB/T 4635—2014 双向拉伸聚酰胺(BOPA)/低密度聚乙烯(PE-LD)复合膜盒中袋
  6. GB/T 43088-2023微束分析 分析电子显微术 金属薄晶体试样中位错密度的测定方法
  7. QB/T 1010-2015 陶瓷材料、颜料真密度的测定方法
  8. GB/T 10671-2023固体材料产烟的比光密度试验方法
  9. GB/T 43799-2024高密度互连印制板分规范
  10. TB/T 2328.12-2008 铁路碎石道砟试验方法第12部分:石料密度试验
  11. YY/T 1254-2015 高密度脂蛋白胆固醇测定试剂(盒)
  12. GB 5009.2-2024食品安全G家标准 食品相对密度的测定
  13. HG/T 2900-1997 聚四氟乙烯树脂体积密度试验方法
  14. TB/T 2328.11-92 铁路碎石道碴石料密度试验方法
  15. HG/T 2872-2009 代替 HG/T 2872-1997 橡塑鞋微孔材料视密度试验方法
  16. SN/T 3518-2013 石油产品运动黏度的测定斯塔宾格黏度计法
  17. GB/T 5252-2020 锗单晶位错密度的测试方法
  18. HG/T 2728-2012 代替 HG/T 2728-1995 橡胶密度的测定 直读法
  19. SN/T 4249-2015 造纸木片水分含量及基本密度测定方法
  20. SN 0045-92 出口石脑油PONA值检验方法利普金双毛细管比重瓶法测定液体的密度和比重
  21. SN/T 0735.6-1997 出口芳香油、单离和合成香料相对密度的测定法
  22. GB/T 23797-2020 病媒生物密度监测方法 蚊虫
  23. SN/T 2383-2017 液体化工品密度和相对密度的测定数字式密度计法
  24. SN/T 1013-2001 进出口棉、涤棉机织物的线密度测定方法
密度densitythe160 | android开发 2022-11-03 128 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阅读器的源码