Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/235.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在android可扩展列表中将标题文本向右对齐_Android_Android Layout - Fatal编程技术网

在android可扩展列表中将标题文本向右对齐

在android可扩展列表中将标题文本向右对齐,android,android-layout,Android,Android Layout,我在我的android应用程序中有一个可扩展的列表,我不能将其项目向右对齐,但我不能将其标题对齐,它们位于左侧 以下是活动布局代码: <ExpandableListView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layoutDirection="rtl" android:id="@+id/expandab

我在我的android应用程序中有一个可扩展的列表,我不能将其项目向右对齐,但我不能将其标题对齐,它们位于左侧

以下是活动布局代码:

<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"/>


下面是标题布局代码:
          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"/>
android:layout\u height=“match\u parent”>

下面是截图:


我也有同样的问题需要找到答案,我就是这样做的

<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" />