dp - sp和PX之间的关系 [英] Relation between dp - sp and PX

查看:154
本文介绍了dp - sp和PX之间的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是问dp,sp和px之间的区别。



我正在根据google的新材料设计设计一个网站,所有的测量都在dp(网格)和sp(文本)。我的问题是他们如何翻译像素。我一直在设计网站超过4年,所有的测量(网格和字体)以像素为单位。



例如:


  1. 标题为24sp,等于?

  2. 网格指南:所有组件都对齐到一个8 dp的正方形基线(不是24像素,我已经尝试匹配它们,它是在28像素,但是必须有一个标准的测量系统)格。


  3. 1px =?dp =?sp在桌面或任何平均显示器上移动设备?

    解决方案

    我建议您阅读Google的dp和sp定义, ,此处此处



    在精彩的设计师DPI指南


    I am not asking what is the difference between dp,sp and px.

    I am designing a website based on google's new material design, all the measurements are in dp (for grid) and sp(for text). My question is how do they translate to pixels. I have been designing websites for more than 4 years and all the measurements (grid and font) are in pixels.

    For Example:

    1. A headline is 24sp, how many pixels does it equate to? (its not 24px, I've tried matching them, it's around 28px but there has to be a standard measuring systems).
    2. Grid Guideline: "All components align to an 8 dp square baseline grid." - how many pixels does it equate to?

    1px = ?dp =?sp on a desktop or any average monitor or mobile device?

    解决方案

    I recommend reading Google's definitions of dp and sp, which can be found in the Android docs, here and here.

    There's also some helpful information in the wonderful Designer's Guide to DPI.

    这篇关于dp - sp和PX之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆