<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/ic_click"
    android:minHeight="66dip" >    <TextView
        android:id="@+id/newstitle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="11.3dip"
        android:paddingRight="52dip"
        android:paddingTop="14dip"
        android:textColor="@color/black"
        android:textSize="@dimen/middleTextSize"
        android:textStyle="bold" >
    </TextView>    <TextView
        android:id="@+id/newsaddTime"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/newstitle"
        android:layout_below="@+id/newstitle"
        android:paddingLeft="11.3dip"
        android:paddingTop="8.6dip"
        android:textColor="@color/black"
        android:textSize="@dimen/smallTextSize" >
    </TextView>    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="5.3dip"
        android:src="@drawable/ic_arrow" >
    </ImageView></RelativeLayout>这个布局是@+id/newsaddTime本来应该在@+id/newstitle下面的,但实际显示的时候@+id/newsaddTime没有在@+id/newstitle的下面,而是默认在Relativelayout布局的顶端,感觉好奇怪,求大家帮忙看看

解决方案 »

  1.   

    楼主有木有经过测试啊,怎么我把你的布局放进我的程序里一测,发现@+id/newsaddTime确实在@+id/newstitle下面??
      

  2.   

    我怎么可能没测试就拿过来的,我已经试了N遍了,但是我上面贴的布局不是顶级布局,他是包含在另外一个布局中,这个问题难办了,我困扰了好多天,最后我没办法,我就改用LinearLayout布局了
      

  3.   

    有可能是你的大布局影响到了你的这个,你把你贴的代码直接拷进另外一个单独的xml里测试一下看看,如果发现结果正确,表示你的大布局有问题啊.
    我自己测试了一下,确定没有你说的问题.
      

  4.   

    楼主把 newsaddTime 的
    android:layout_alignLeft="@+id/newstitle"
    android:layout_below="@+id/newstitle"
    两个 +号 去掉试试
    android:layout_alignLeft="@id/newstitle"
    android:layout_below="@id/newstitle"
      

  5.   

    <TextView
            android:id="@+id/newsaddTime"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/newstitle"
            android:layout_below="@+id/newstitle"  //把加号去掉看看
            android:paddingLeft="11.3dip"
            android:paddingTop="8.6dip"
            android:textColor="@color/black"
            android:textSize="@dimen/smallTextSize" >
        </TextView>
      

  6.   

    android:layout_alignLeft="@+id/newstitle"楼主去掉这条语句看看呢
      

  7.   

    android:layout_alignLeft="@+id/newstitle"
    这句要去掉,这应该是默认在newstitle左边了
      

  8.   

    ID前有加号表示新ID,没加号表示引用其他ID指定的对象,应该是这样吧。
      

  9.   

    谢谢大家了,经过搜索,知道了这是android的RelativeLayout布局的一个bug