【发布时间】:2016-10-17 07:04:23
【问题描述】:
我遇到的问题是我似乎无法让它正确地匹配_parent。我想要它做的是延伸到页面的末尾,如下图所示。 我几乎尝试了所有方法,但我想出的唯一解决方案是添加一个固定的像素,这是我不想做的事情,因为它在不同平台之间发生冲突。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="net.battleplugins.msutton.fragemento.MainActivity">
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/menu_row">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="75dp"
android:orientation='horizontal'>
<RadioButton
android:text="@string/quiz_button_title"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:id="@+id/quiz_button"
android:button="@android:color/transparent"
android:background="@drawable/buttonbackground"
android:layout_weight="1"
android:onClick="updateFragment"/>
<RadioButton
android:text="@string/picture_button_title"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:id="@+id/picture_button"
android:button="@android:color/transparent"
android:background="@drawable/buttonbackground"
android:layout_weight="1"
android:onClick="updateFragment"/>
<RadioButton
android:text="@string/events_button_title"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:id="@+id/events_button"
android:button="@android:color/transparent"
android:background="@drawable/buttonbackground"
android:layout_weight="1"
android:onClick="updateFragment"/>
</RadioGroup>
</TableRow>
</TableLayout>
</RelativeLayout>
我得到的是这样的:
我想要它做的是:
问题在于这是一个固定的金额。 RadioGroup中的android:layout_width="1075px"
【问题讨论】:
标签: android android-layout android-studio