Android的屏幕尺寸分辨率 [英] Android screen size resolution

查看:200
本文介绍了Android的屏幕尺寸分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序完全在分辨率为480x800。如果我把480x800的分辨率,但改变屏幕尺寸,例如2.7英寸,3.7英寸或5.4英寸它仍然是完美的。但是,当我更改分辨率为例如640x1066所有ImageButtons太小,在所有的屏幕尺寸错误的地方...我已经创造了所有的四个文件夹(可绘制-L,M,H,XH),但仍是ImageButtons按钮是不是在正确的大小..

My app works perfectly in resolution 480x800. If I keep the 480x800 resolution but change the screen size to for example 2.7 inches, 3.7 inches or 5.4 inches it still is perfect. But when I change the resolution to for example 640x1066 all the ImageButtons is too small and in the wrong place in all screen sizes... I have created ImageButtons in all four folders(drawable-l, m, h, xh) but still the buttons is not in the correct size..

<ImageButton
android:id="@+id/ib1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginTop="433dp"
android:background="@drawable/imagebutton1" />

<ImageButton
android:id="@+id/ib2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="188dp"
android:layout_marginTop="436dp"
android:background="@drawable/imagebutton2" />

注:我的问题,不是我改变屏幕尺寸,但是当我改变屏幕分辨率

NOTE: My problem is not when I change screen size, but when I change screen resolution.

推荐答案

我真的很想看到一些code。

I would really like to see some code.

如果您使用 RelativeLayout的中包含 Android的属性:layout_width 安卓layout_height 和指定的 DP (像素密度)值,例如机器人:layout_height =40dp这应该只是罚款

If you use RelativeLayout with attributes like android:layout_width and android:layout_height and specify values in dp (density pixels) e.g. android:layout_height="40dp" it should work just fine.

请尽量与我们分享一些code。

Please try to share some code with us.

这篇关于Android的屏幕尺寸分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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