2

How can I change the gravity of a preference page to RIGHT? is there any solution?

Bob
  • 22,810
  • 38
  • 143
  • 225
  • Do you mind explaining it further? What are you trying to achieve? What are the options that you tried? What are your blockers? – Kalarani Jul 11 '11 at 08:30
  • any answers for this question? – Bob Jul 16 '11 at 08:38
  • my language is Farsi. I can show strings of the preference page in Farsi but I can't set its gravity to RIGHT. – Bob Jul 23 '11 at 05:01

1 Answers1

0

All preferences have a Layout Attribute. You can use this to format all your Farsi text. However the layout you give it must have a TextView with the id of "@+android:id/title".

Here is a quick example with an image added and right justified text.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="70dip"   
    >

    <ImageView
        android:id="@+id/perf_image"
        android:src="@drawable/pin_red"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true" />

    <TextView
        android:id="@+android:id/title"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textSize="23dip"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/perf_image"
        android:text="stuff"
        style="@android:style/TextAppearance.Widget.TextView.PopupMenu"
        android:gravity="right"
        />

</RelativeLayout>
riotopsys
  • 564
  • 4
  • 7