在我的应用程序中,我有一个以这种方式显示菜单的视图......但我想为所有类型的屏幕调整这 4 个按钮,也就是说,我希望这些按钮具有动态大小......你有什么建议吗?谢谢
这是我当前的代码...
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.game.SplashActivity" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/back_menu"
android:scaleType="centerCrop"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:src="@drawable/bt_1_player"
android:layout_weight="1"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:src="@drawable/bt_2_player"
android:layout_weight="1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:src="@drawable/challenge_bt"
android:layout_weight="1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:src="@drawable/special_bt"
android:layout_weight="1"/>
</LinearLayout>