lok*_*oki 7 delphi android ios firemonkey
当我在智能手机上做应用程序时,我定义(例如)一个20px*20px的图标.这个图标在我的手机屏幕上看起来很棒,但不适用于大屏幕的平板电脑(如ipad pro).在这种情况下,图标看起来很小.
如果我按比例增加屏幕图标的大小,那么图标最终看起来太大了.举个例子:
有人知道设置图标/字体/等大小的好规则.根据屏幕的大小?我在delphi下(firemonkey)
在针对不同设备进行设计时,无论操作系统如何,都需要考虑两件事:第一是屏幕密度,第二是物理屏幕尺寸。
\n\n仅仅知道屏幕像素大小就能够对设备进行分类是不够的。例如,10 英寸平板电脑和 24 英寸桌面显示器上的 1920x1080 像素显示之间存在差异。为了描述我们可以使用的真实屏幕空间,有一个术语“设备独立像素- dp或dial ”。这是针对指定操作系统以 100% 比例描述单个像素的基线大小。
\n\n不同的操作系统有不同的基线密度。对于 Windows,该分辨率为 96 dpi;对于 Android,该分辨率为 160 dpi;对于 iOS,该分辨率为 163 dpi。此外,这些密度因设备而异,因此实际的硬件屏幕密度通常与逻辑密度不同。想象一下 1920x1080 像素 22 英寸和 24 英寸显示器之间的差异。两者具有相同的声明操作系统(Windows 密度为 96dpi),但实际硬件密度和物理尺寸不同。
\n\n每个操作系统都有一些关于图标和字体大小的设计指南,您应该在基线密度下使用它们,然后您应该将它们放大以适应更高密度的屏幕。
\n\nFonts have additional dimension defined as user defined font scale. That means users can choose to increase or decrease baseline font scale - on Android that is called Scale-independent Pixels (sp), on iOS term is Dynamic Type Size. It is preferable that you take user defined font preference into account when declaring font sizes, but in certain circumstances when you are writing text over images or you are doing some other more precise design, you can ignore user size and use default baseline size to make sure your design will not fall apart for non-default font scale settings.
\n\nIn practice, when you have icon 20x20dp in size you will use same size on all devices. You can use slightly bigger icons on large screen devices (tablets) but just scaling your image by factor 3 is not going to look good. Also, there are no definitive rules on how bigger those icons have to be. It will all depend on your application. If you are making text editor, or image editor, you will want to leave icons small in order to give more useful space on larger devices. On the other hand for some games you may just scale whole thing up to fit the screen regardless of the size. It is totally up to you.
\n\nMost common scales and screen sizes (dpi densities are informative, real devices densities may vary):
\n\nAndroid
\n\nsmall screen - at least 426dp x 320dp\nnormal screen - at least 470dp x 320dp\nlarge screen - at least 640dp x 480dp\nxlarge screen - at least 960dp x 720dp\n\n0.75x ldpi ~120dpi\n1.0x mdpi ~160dpi\n1.5x hdpi ~240dpi\n2.0x xhdpi ~320dpi\n3.0x xxxhdpi ~480dpi\n4.0x xxxhdpi ~640dpi\nRun Code Online (Sandbox Code Playgroud)\n\niOS
\n\n1.0x @1x ~163dpi\n2.0x @2x ~326dpi\n3.0x @3x ~401dpi\nRun Code Online (Sandbox Code Playgroud)\n\nWindows
\n\n1.0x ~96dpi\n1.25x ~120dpi\n1.5x ~144dpi\n2.0x ~192dpi\nRun Code Online (Sandbox Code Playgroud)\n\nFurther reading:
\n\nMaterial design - Layout \xe2\x80\x93 Units and measurements
\n\nAndroid Supporting Multiple Screens
\n\n\n\niOS Human Interface Guidelines - Typography
\n| 归档时间: |
|
| 查看次数: |
859 次 |
| 最近记录: |