把这个
<!-- 箭头图像、进度条 -->  
            <FrameLayout
设置
android:id="@+id/jiantou"
android:layout_centerHorizontal="true" 

 <!--  提示、最近更新 -->
            <LinearLayout  
设置放在他的右边
android:layout_toRightOf="@id/jiantou" 

解决方案 »

  1.   

    你设置了android:gravity="center_horizontal" 
      

  2.   

    你看我这么设置它也不居中啊<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingTop="5dp"
        android:paddingBottom="5dp"
        android:background="#FFFFFFFF"
        android:layout_centerVertical="true" >
    <RelativeLayout
        android:id="@+id/head_contentLayout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"  
                android:layout_centerVertical="true">
         <!-- 箭头图像、进度条 -->  
            <FrameLayout
                android:id="@+id/jiantou"
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content" >
                
            <!-- 箭头 -->
            <ImageView
            android:id="@+id/pull_to_refresh_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
            
        <ProgressBar
            android:id="@+id/pull_to_refresh_progress"
            style="@android:style/Widget.ProgressBar.Small"
            android:indeterminate="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
                     android:visibility="gone" /> 
            </FrameLayout>
            
    <!--  提示、最近更新 -->
            <LinearLayout  
                android:layout_toRightOf="@+id/jiantou"
                android:layout_marginLeft="20dip"
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:orientation="vertical" >
            <TextView
            android:id="@+id/pull_to_refresh_text"
            android:text="@string/pull_to_refresh_pull_down_label"
            android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="12sp" />
            
        <TextView
            android:id="@+id/pull_to_refresh_lastdatetext"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="10sp"/>
            </LinearLayout>
    </RelativeLayout>
    </LinearLayout>
      

  3.   


    这样设置不垂直居中显示,箭头和文字都贴着左边显示
    不会啊,我写了demo测试了,都可以居中显示的
      

  4.   


    这样设置不垂直居中显示,箭头和文字都贴着左边显示
    不会啊,我写了demo测试了,都可以居中显示的
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingTop="5dp"
        android:paddingBottom="5dp"
        android:background="#FFFFFFFF" >
    <RelativeLayout
        android:id="@+id/head_contentLayout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp">
         <!-- 箭头图像、进度条 -->  
            <FrameLayout
                android:id="@+id/jiantou"
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:layout_alignParentLeft="true"  
                android:layout_centerVertical="true" >
                
            <!-- 箭头 -->
            <ImageView
            android:id="@+id/pull_to_refresh_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_centerVertical="true" />
            
        <ProgressBar
            android:id="@+id/pull_to_refresh_progress"
            style="@android:style/Widget.ProgressBar.Small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
                     android:visibility="gone" /> 
            </FrameLayout>
            
    <!--  提示、最近更新 -->
            <LinearLayout  
                android:layout_toRightOf="@+id/jiantou"
                android:layout_marginLeft="16dp"
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:layout_centerHorizontal="true"
                android:gravity="center_horizontal"  
                android:orientation="vertical" >
            <TextView
            android:id="@+id/pull_to_refresh_text"
            android:text="@string/pull_to_refresh_pull_down_label"
            android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="12sp" />
            
        <TextView
            android:id="@+id/pull_to_refresh_lastdatetext"
            android:textSize="10sp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
            </LinearLayout>
    </RelativeLayout>
    </LinearLayout>你看看我这个图 就这么刷新怎么就在左边呢
      

  5.   


    这样设置不垂直居中显示,箭头和文字都贴着左边显示
    不会啊,我写了demo测试了,都可以居中显示的
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingTop="5dp"
        android:paddingBottom="5dp"
        android:background="#FFFFFFFF" >
    <RelativeLayout
        android:id="@+id/head_contentLayout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp">
         <!-- 箭头图像、进度条 -->  
            <FrameLayout
                android:id="@+id/jiantou"
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:layout_alignParentLeft="true"  
                android:layout_centerVertical="true" >
                
            <!-- 箭头 -->
            <ImageView
            android:id="@+id/pull_to_refresh_image"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_centerVertical="true" />
            
        <ProgressBar
            android:id="@+id/pull_to_refresh_progress"
            style="@android:style/Widget.ProgressBar.Small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
                     android:visibility="gone" /> 
            </FrameLayout>
            
    <!--  提示、最近更新 -->
            <LinearLayout  
                android:layout_toRightOf="@+id/jiantou"
                android:layout_marginLeft="16dp"
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:layout_centerHorizontal="true"
                android:gravity="center_horizontal"  
                android:orientation="vertical" >
            <TextView
            android:id="@+id/pull_to_refresh_text"
            android:text="@string/pull_to_refresh_pull_down_label"
            android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="12sp" />
            
        <TextView
            android:id="@+id/pull_to_refresh_lastdatetext"
            android:textSize="10sp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
            </LinearLayout>
    </RelativeLayout>
    </LinearLayout>你看看我这个图 就这么刷新怎么就在左边呢
    这里应该这么改<!--  提示、最近更新 -->
            <LinearLayout  
                android:layout_toRightOf="@+id/jiantou"
                android:layout_marginLeft="16dp"
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:orientation="vertical" >