【发布时间】:2015-04-25 06:58:06
【问题描述】:
我有 3 个控件,我希望一个左对齐,另一个居中,最后一个在相对布局中一直向右。
我已经尝试过以下方法:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent">
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:id="@+id/backimg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/back"
android:background="@null"
android:layout_alignParentLeft="true"
/>
<ImageView
android:id="@+id/logoimg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/logo"
android:background="@null"
android:layout_centerHorizontal="true"
/>
<ImageButton
android:id="@+id/closebtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/close"
android:background="@null"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
这会将所有控件堆叠在一起。
我怎样才能让它看起来像这样:
【问题讨论】:
标签: android android-layout android-relativelayout