Home  >  Q&A  >  body text

android 布局有个黄色叹号

This LinearLayout layout or its RelativeLayout parent is possibly useless; transfer the background attribute to the othe
线性布局上面有个叹号,怎么去掉

PHP中文网PHP中文网2712 days ago1076

reply all(3)I'll reply

  • 阿神

    阿神2017-04-17 11:43:43

    它的意思是说,你的LinearLayout或者RelativeLayout是没有必要的。你可以在LinearLayout重新设置background属性,或者删除RelativeLayout,用LinearLayout作为最外层布局

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 11:43:43

    你用了过期的参数,提示你

    fill_parent 从很早以前就列入过期..

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 11:43:43

    警告原因:警告提示的意思是在这个布局文件中父布局控件(最外层的LinearLayout)没有用;原因是在LinearLayout布局当中嵌套了一个子的LinearLayout布局,而在我的这个整个布局文件中是一最外层的LinearLayout为父控件进行整体布局的,从而造成这段布局代码重复了LinearLayout布局。

    结局方法很简单只需要重复的一个LinearLayout即可

    http://www.2cto.com/kf/201404/292892.html

    reply
    0
  • Cancelreply