对齐TextView,按钮,EditText
问题描述:
如何将我的TextView和Button对齐到左侧,EditText和Button对齐?这是包含未对齐项目的表单。对齐TextView,按钮,EditText
我的XML文件是:
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
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=".MainActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<RelativeLayout
android:id="@+id/PlateEntryRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/RequestButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/PlateEdit"
android:text="@string/request" />
<TextView
android:id="@+id/PlateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/PlateEdit"
android:layout_alignBottom="@+id/PlateEdit"
android:layout_alignParentLeft="true"
android:text="@string/plate"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/PlateEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@android:drawable/editbox_background"
android:ems="10"
android:gravity="right|center_vertical" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ToggleButton
android:id="@+id/toggleButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fitsSystemWindows="false"
android:text="ToggleButton" />
</LinearLayout>
答
它看起来很符合我。你可以更具体一点 – akaya 2013-02-14 15:51:22
看看“P”字母和更详细的按钮左框架 – sanchop22 2013-02-14 15:53:01