eclipse提示:
This RelativeLayout layout or its LinearLayout parent is possibly 
 useless; transfer the background attribute to the other view
但实测都有用,怎么处理这个提示?奉上代码:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget52"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"android:background="@drawable/beijing_heng"   
>
<!-- 横向 -->
<RelativeLayout
android:id="@+id/widget54"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/widget01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/ling_dang"
android:contentDescription="@string/hello"
android:paddingTop="10dip"
>
</ImageView>
<ImageView
android:id="@+id/widget02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/plm"
android:contentDescription="@string/hello"
android:paddingTop="80dip"
>
</ImageView>
<ImageView
android:id="@+id/widget03"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/jiantou_you"
android:contentDescription="@string/hello"
android:paddingTop="150dip"
>
</ImageView>
</RelativeLayout>
</LinearLayout>
这个代码实测都有用的。

解决方案 »

  1.   

    在上面<RelativeLayout的行上出的提示,主要是有叹号提示看着不怎么爽。
      

  2.   


    我的确实有,就在<RelativeLayout的旁边,然后从<RelativeLayout开始一直到最后的</RelativeLayout>的部分是加蓝的
      

  3.   

    弄明白了,RelativeLayout这个之外必须还有其它控件,也可能是这些控件属性设置的问题
      

  4.   

    这些提示告诉你RelativeLayout 外面有一个 LinearLayout,这个 LinearLayout是无效的,你可以去掉这个 LinearLayout,如果不去掉的等方面   RelativeLayout 北京是透明的,北京用LinearLayout背景颜色。
      

  5.   

      你的北京 指 background 吧
      

  6.   

    8楼正解 你在viewgroup里面仅仅套了一个viewgroup 那eclipse就会觉得你最外面的是没用的
    就像你把一个篮子放到另一个篮子里面 再装东西  那最外那那个 不是没有用么
      

  7.   

    楼上有道理,把android:background="@drawable/beijing_heng"    放在RelativeLayout中,把LinearLayout干掉
      

  8.   

    干吗要LinearLayout就嵌一个RelativeLayout呢。外面的linearLayout岂不没啥用,直接去掉外面的LinearLayout,直接用RelativeLayout不久行了,兄弟不要浪费资源啊   哈哈