経由ここでは私のXMLコードで、それはのLinearLayoutのID =「linearLayout2」の前に立ってImageViewのを持っていますアンドロイド - のLinearLayoutでスワップビューXML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout1"
android:background="@drawable/border"
android:paddingBottom="5dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/ic_swap"
android:layout_gravity="center_vertical" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout2"
android:paddingBottom="5dp"
android:layout_marginRight="5dp">
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/fromStationField"
android:completionThreshold="1"
android:hint="From"
android:textAlignment="textStart"
android:gravity="left|start"
android:layout_gravity="left" />
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/toStationField"
android:completionThreshold="1"
android:hint="To"
android:background="@android:color/transparent"
android:paddingRight="4dp"
android:paddingLeft="4dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
私が何をしたいのかImageViewのは、後に立っているようにすることですLinearLayout id = "linearLayout2"私は画像の下に示すように。
xmlのみを使用してこれを行う方法は?以下のレイアウトで
だから、左からではなく右側から画像ビューが必要ですか? – sJy
sJy、はい、正確です。 – gigs