ボタンの高さを設定するのに問題がありますが、エミュレーターが望ましく表示されている間 (ボタンが狭い)、電話デバイス S2 で実行されています (ボタンが正方形になります)。エミュレーターのようにボタンが狭く表示されるように正しく設定するにはどうすればよいですか?
ボタンを textSize = 1dp で wrap_content に設定すると、エミュレーターはこの変更を非常に狭いボタンとして正しく反映して表示しますが、S2 で実行するとまだ正方形として表示されます。
実際のデバイスで正常に実行する方法を知っている人はいますか? どうもありがとう!!!
エミュレータ:
電話デバイス:
レイアウト コード:
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/light_blue"
android:orientation="horizontal" >
<Button
android:id="@+id/colorBlackBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="1dp"
android:layout_weight="1"
android:background="@drawable/black_btn" />
<Button
android:id="@+id/colorWhiteBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="1dp"
android:layout_weight="1"
android:background="@drawable/white_btn" />
<Button
android:id="@+id/colorRedBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="1dp"
android:layout_weight="1"
android:background="@drawable/red_btn" />
// same for other buttons
</TableRow>