<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/btn1"/>
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@+id/btn1"/>
<!--x7-->
我在其相關佈局中放置了7個按鈕。我想調整他們的'寬度'到相同的大小以適合屏幕。我應該怎麼辦RelativeLayout中的自動縮放按鈕的寬度
是否有必要將relativeLayout作爲父項? –
android:layout_width =「match_parent」不起作用? – Vega
如果我可以做到這一點沒有relativeLayout,我不會把relativeLayout作爲父項。 –