2

エミュレータでは、edittext とボタンのサイズは見栄えがしますが、motorola のマイルストーンでは、どちらも非常に小さいです。画面構成はいろいろあると思います。サイズを自動で調整することはできますか?私の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"/>                                 

携帯電話を縦向きから横向きに変えながら自動サイズ変更された edittext を取得するには、これらの xml コードを AndroidManifest.xml に追加します。

    <supports-screens android:smallScreens="true"
              android:normalScreens="true"
              android:largeScreens="true"
              android:anyDensity="true" />

しかし、何も変わらない =[. それを修正する方法は?

ありがとうございました。

4

1 に答える 1

1

画面密度に基づいてサイズを変更する場合は、dipの代わりに for を使用しpxます。

于 2010-06-25T10:45:57.670 に答える