1
Pleae看看下面的XML的Android的LinearLayout爲右對齊
我想文字
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/list_selector"
android:orientation="horizontal"
android:padding="6dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@drawable/rounded_corner"
android:orientation="vertical" >
<ImageView
android:id="@+id/image_category"
android:layout_width="72dp"
android:layout_height="72dp"
android:contentDescription="@string/app_name"
android:padding="0dp"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:orientation="vertical" >
<TextView
android:id="@+id/txt_allphotos_categty"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:text=""
android:textColor="@color/texthoverclr"
android:gravity="right"
android:textSize="20sp" />
</LinearLayout>
前圖像對準到這樣,我想對齊照片然後右邊的文字
使用相對佈局而不是線性佈局,這將很容易。 –
您可以在Manifest中啓用RTL支持。 –
你的意思是這個android:supportsRtl =「true」? cand你能爲我編輯代碼嗎? – user3418508