私はアプリケーションを開発しました。私が開発したサイズは3.7インチWVGANexusOneでした。
そのため、この画面より大きく表示しても問題ありません。3.7インチより小さく表示すると問題が発生しました。
これが私のxmlです。いくつかのウィジェットに固定ピクセルを使用しています。
<LinearLayout
android:id="@+id/layout_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/layout_title"
android:background="@drawable/backrepeat"
android:gravity="center_vertical|center_horizontal" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal" >
<TableRow
android:layout_width="fill_parent"
android:gravity="center_vertical|center_horizontal"
android:paddingBottom="10px"
android:paddingTop="10px" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal" >
<TextView
android:id="@+id/fixtext_name"
android:layout_width="80px"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingBottom="10px"
android:text="姓名 :"
android:textColor="#000000"
android:textSize="30px" />
<EditText
android:id="@+id/text_name"
android:layout_width="400px"
android:layout_height="wrap_content"
android:ems="15"
android:gravity="left"
android:inputType="textPersonName"
android:paddingBottom="10px"
android:textSize="30px" >
</EditText>
</LinearLayout>
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
これは私のアプリケーションレイアウトの例です。全幅は480px、高さは
fill_parent
ですから、高さは問題ありません。
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="480"
android:compatibleWidthLimitDp="480"
android:largestWidthLimitDp="480" >
</supports-screens>
これは、マニフェストxmlのsupport-screen属性です。私はすでにすべてを設定しました。
問題は、2.7インチQVGA(SG Miniなど)で表示すると、フルスクリーンアイテムではなく240px幅しか表示されないことでした。
アプリケーションの画面サイズに基づいてアプリケーションベースをスクイーズまたはサイズ変更する方法を知りたいですか?
可能であれば、すべてのアクティビティに対して同じものをコーディングする必要がありますか?