【发布时间】:2015-03-17 03:17:25
【问题描述】:
我正在尝试调整旋转按钮的大小以按比例展开。现在,它们是固定长度,但我不确定让按钮调整大小的替代方法(设置重量似乎没有帮助)。我希望按钮基本上垂直和水平地填充屏幕的长度。如果您需要更多信息,请告诉我。
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_gravity="center_vertical" >
<Button
android:id="@+id/mainCommentBtn"
android:layout_width="119dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_weight="1"
android:text="@string/commentBtn" />
<Button
android:id="@+id/mainProfileBtn"
android:layout_width="119dp"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_weight="1"
android:layout_centerInParent="true"
android:text="@string/profileBtn" />
<Button
android:id="@+id/mainDetailBtn"
android:layout_width="119dp"
android:clickable="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="@string/shareBtn" />
</LinearLayout>
【问题讨论】:
标签: android xml android-layout android-linearlayout android-button