如何处理在Android上不同大小的屏幕 [英] How to handle different sizes of screen on android

查看:104
本文介绍了如何处理在Android上不同大小的屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我在模拟器上运行程序。在那之后,我跑在许多Android手机。有些是非常小的,有些是展现在旋转侧则不能旋转回来,不能滚动(我没有做到这一点),有些是确定。

First, I run program on emulator. After that, I run on many android phones. Some are very small, some are show in rotate side then can't rotate back, and can't scroll (I did not do that), some are OK.

我的理解可能是由不同类型的屏幕造成的,我用AbsoluteLayout,但我不知道如何解决这个problem.So,我需要解决这个问题。任何人都可以帮忙吗?由于嘉

I understand may caused by different types of screen and I used AbsoluteLayout, but I do not know how to solve that problem.So, I need to resolve this problem. Anyone can help? Thanks ka

示例页面:

  <?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<TextView
    android:id="@+id/usrname"
    android:layout_width="wrap_content"
    android:layout_height="21px"
    android:layout_x="105px"
    android:layout_y="179px"
    android:text="Username :"
    android:textSize="18sp"
    android:textStyle="bold" />

<EditText
    android:id="@+id/usrname_text"
    android:layout_width="161px"
    android:layout_height="wrap_content"
    android:layout_x="74px"
    android:layout_y="206px"
    android:textSize="12sp" />

<TextView
    android:id="@+id/pass"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_x="105px"
    android:layout_y="252px"
    android:text="Password :"
    android:textSize="18sp"
    android:textStyle="bold" >
</TextView>

<EditText
    android:id="@+id/pass_text"
    android:layout_width="163px"
    android:layout_height="wrap_content"
    android:layout_x="73px"
    android:layout_y="279px"
    android:password="true"
    android:textSize="12sp" />

<Button
    android:id="@+id/login"
    android:layout_width="73px"
    android:layout_height="wrap_content"
    android:layout_x="75px"
    android:layout_y="333px"
    android:text="Login" />

<Button
    android:id="@+id/cancle"
    android:layout_width="73px"
    android:layout_height="wrap_content"
    android:layout_x="157px"
    android:layout_y="333px"
    android:text="Cancel" />

</AbsoluteLayout>

这些都来自银河-S图片和仿真器:

These are pictures from Galaxy-S and emulator :

推荐答案

FO rthis问题u使用在manifestfile.For支持屏幕标签还引用见下面链接的支持屏幕

fo rthis problem u use Support screens tag in manifestfile.For further reference see the below link Support screens

这篇关于如何处理在Android上不同大小的屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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