当前位置:网站首页>How big is 1dp!
How big is 1dp!
2022-08-08 17:18:00 【Wholehearted】
Why is 1dp a fixed length?How long is it?
Why do you say px is a relative length, if you don't know dpi, you don't know how long it is.
First of all, we have to distinguish a concept
Control, text, we use dp, sp, so on different devices, it will be converted into corresponding px according to the dpi of the device
Therefore, it is guaranteed to be the same size on different devices.
For example, how big is 1dp
1dp runs on a 160dpi machine, then 1dp=1px and knowing that dpi=160 means that there are 160 pixels per inch, then the length of a pixel is 1/160 of an inch.
And 1dp runs on a 320dpi machine, then 1dp=2px knows dpi=320, that is, the length of a pixel is 1/320 inch, to display a 1dp control requires 2px, then the length is 2*1/320 Still yes1/160 of an inch, so the length is fixed.
As for the picture, since the unit of the picture is px, it needs to be adapted. It is necessary to create different folders according to different devices, and store the different pixel sizes of the same picture in different folders. When the real machine is runningThe pictures in the appropriate folder will be loaded according to the dpi of the real machine.
And if you only have one image, the px size is fixed. Naturally, when running on different devices, the displayed size of this image is different.
边栏推荐
- L2-017 人以群分 (25 分)
- 【 8.7 】 source code - card to LCM with GCD 】 【 】
- mysql进阶(二十九)常用函数汇总
- LeetCode_回溯_中等_491.递增子序列
- L2-020 功夫传人 (25 分)
- 爬百度图片
- 手机ETF基金开户哪家证券公司好?哪个更安全
- The latest research from PNAS: 81% problem solving rate, neural network Codex opens the door to the world of advanced mathematics
- banner 如何显示drawable图片
- Qt——获取文件夹下所有子文件名称
猜你喜欢
项目管理流程包含哪些
【CC3200AI 实验教程4】疯壳·AI语音人脸识别(会议记录仪/人脸打卡机)-GPIO
Mysql都有那些最需要掌握的原理?
七、jmeter发出请求的逻辑
Acwing第 63 场周赛【未完结】
arxiv国内镜像——快速下载
leetcode:296.最佳的碰头地点
[Paper Reading] RAL 2022: Receding Moving Object Segmentation in 3D LiDAR Data Using Sparse 4D Convolutions
测试/开发程序员停滞不前,倦怠怎么办?突破各种失败和挫折......
史上最强IDEA工具使用教程,你想要的全都有!
随机推荐
The difference between B+ tree and B- tree
leetcode:294.翻转游戏
L2-020 功夫传人 (25 分)
leetcode:295. 数据流的中位数
【开源教程2】疯壳·开源编队无人机-硬件资源简介
看到这个应用上下线方式,不禁感叹:优雅,太优雅了!
MySQL 数据库
多线程-并发编程
R文件找不到问题
Digital image processing (6) -- image compression
JVM-简介&垃圾回收&内存泄漏分析
DSPE-PEG-Biotin,385437-57-0,磷脂-聚乙二醇-生物素用于生物分子的检测和纯化
Is it safe to open an account with CICC Wealth?How does it work?
laravel数据库: 查询构造器
2022-08-08日报:Kaggle所有竞赛开源方案和Top思路汇总
Qt——获取文件夹下所有子文件名称
C1. Pokémon Army (easy version)
五、jmeter脚本的基本构成&断言
L2-017 人以群分 (25 分)
顺序表与链表结构及解析