我正在为我的应用程序整理布局。在底部,我想让 2ImageView
并排居中,但它们是左对齐的。我将重力设置为中心,不工作。
xml文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff29245c"
android:orientation="vertical" >
<ScrollView
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/parschute"
android:id="@+id/ok"
android:layout_gravity="center"
android:layout_marginTop="12px" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
// WOULD LIKE THE 2 IMAGEVIEWS BELOW TO BE NEXT TO BE ON SAME LINE AND CENTERED
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pulldown"
android:layout_gravity="center"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/camera"
android:layout_gravity="center"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>