在模拟器中,编辑文本和按钮的大小看起来很不错,但在摩托罗拉的里程碑中,它们都太小了。我认为有不同类型的屏幕布局。可以自动调整大小吗?我的xml如下:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<EditText android:id="@+id/txtToText_e"
android:layout_width="270px"
android:layout_height="wrap_content"
android:textSize="18sp"
android:hint="Type To Compose"
android:layout_alignParentBottom = "true"
android:layout_alignParentLeft="true"/> <Button android:text="Send"
android:id="@+id/btnDone_e"
android:layout_width="85px"
android:layout_height="wrap_content"
android:layout_alignParentBottom = "true"
android:layout_alignParentRight="true"/>
为了在将电话从纵向变为横向时自动调整编辑文本的大小,我在AndroidManifest.xml中添加了以下xml代码
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />但没有什么变化=[。如何修复它?
谢谢。
发布于 2010-06-25 18:45:58
如果要根据屏幕密度更改大小,请使用dip代替px作为尺寸。
https://stackoverflow.com/questions/3116618
复制相似问题