私は自分用のカー ドック アプリケーションを作成しており、アプリケーションへのショートカットを配置できる 6 つのボタンがあります。横向きモードと縦向きモードのレイアウトを設計しました。ポートレート モードでの画面サイズに問題があります。アイコンを次のように並べています。
Text up here
------------
| 1 | 2 |
------------
| 3 | 4 |
------------
| 5 | 6 |
------------
ボタンの XML は次のとおりです。
<Button
android:id="@+id/btnLaunchSlotOne"
style="@style/launchButton"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_weight="1"
android:layout_marginRight="8dp"
android:padding="10dp"
android:text="Navigation"
android:textColor="#ffffff" />
今私が抱えている問題は、アプリを小さな画面サイズでテストすると、ボタンのサイズが変更されないようで、下部の画面から消えてしまうことです。それらを適切にスケーリングするにはどうすればよいですか? 「dp」を使用すると、すべてが処理されると思いましたか?
プログラムで画面サイズを計算する必要がありますか?
提案/助けてくれてありがとう!