1

I have a Expandable List in my android app which I cant align its items to right but I cant do this to its headers, and they are in left side.

Here is activity layout code:

<ExpandableListView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layoutDirection="rtl"
        android:id="@+id/expandableListView1" android:layout_weight="0" android:padding="5dp"/>
<Space
        android:layout_width="fill_parent"
        android:layout_height="25dp"
        />
<com.mapquest.android.maps.MapView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map2"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:apiKey="Fmjtd%7Cluurnu0r25%2C2s%3Do5-9w82u0"
        android:layout_weight="1" android:padding="5dp" android:visibility="invisible"/>

and here is the header layout code:

          android:layout_height="match_parent">
<TextView
        android:id="@+id/lblHomeListHeader"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
        android:textSize="17dp"
        android:gravity="right"
        android:textColor="#ff4c3c" android:text="xzcxzc"/>

and here is the screenshot:

enter image description here

Babak Fakhriloo
  • 2,076
  • 4
  • 44
  • 80

1 Answers1

-1

I had ditto same issue to find an answer to, I did it like this

<RelativeLayout 
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
 android:id="@+id/row_group_name"
 android:layout_width="wrap_content"
 android:textSize="24sp"
 android:layout_alignParentRight="true"
 android:textAllCaps="true"
 android:layout_height="wrap_content" />

Check here for extended answer

Community
  • 1
  • 1
sud007
  • 5,824
  • 4
  • 56
  • 63