简体   繁体   English

使活动规模在所有设备上都相同吗? -安卓

[英]Make activity scale to be the same on all devices? - Android

Can what is described in the title be done? 标题中描述的内容可以完成吗? I mean the whole activity just scales up or down to take up the same percentage of the device screen, so buttons and everything else, all views, all free space, margins, grow on a big screen. 我的意思是,整个活动只是按比例放大或缩小,以占据设备屏幕的相同百分比,因此按钮和其他所有内容,所有视图,所有可用空间,边距都在大屏幕上增长。 Is this what "dp" is? 这是“ dp”是什么? So setting all measurements in dp where possible would do this? 那么在dp中设置所有测量值会做到这一点吗?

Thanks. 谢谢。

dp is the unit you have to use in your dimensions, so everything scales depending on the density of the device. dp是您必须在尺寸中使用的单位,因此一切都取决于设备的密度。 But probably you also need to take care of the actual physical size of the screen, the with/height ratio, etc... 但可能您还需要照顾屏幕的实际物理尺寸,宽高比等。

You better read this document 您最好阅读此文档

http://developer.android.com/guide/practices/screens_support.html http://developer.android.com/guide/practices/screens_support.html

until everything is quite familiar to you 直到您对一切都熟悉为止

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM