try
    <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >            <TextView
                android:id="@+id/notice_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:textColor="@color/content_text_color"
                android:textSize="14sp" />            <ImageView
                android:id="@+id/notice_attachment"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:src="@drawable/attachment" />
        </LinearLayout>

解决方案 »

  1.   

    如果你的回形针图标是跟在文字的结尾的,可以用spanablestring来做啊,把某段文件转换成一个图标,然后直接给这个textview赋值为这个spanablestring即可
      

  2.   

    TextVeiw 本身有个drawable_right属性,让一个图标显示在右侧。这样就不用TextView+ImageView来实现了。
      

  3.   


    最后用SpannableString  ImageSpan解决的,还是谢谢你
      

  4.   


    这个我知道,试过了,但图标不是显示在文字结尾,而都是显示在最右边最后用SpannableString  ImageSpan解决的,还是谢谢你