Error: Android-XML:Placing a in a parent element that uses a wrap_content size can lead to subtle bugs; use match_parent

后端 未结 4 1335
夕颜
夕颜 2021-02-13 13:20

I am a beginner in Android and building a linear layout and getting an error in the layout XML file like this,

Error

 Placi         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-13 14:01

    Actually I think that this is a bug in Eclipse, or the latest version 20 Android SDK.

    I have screen designs that are made up of stacked web views because their contents come from different sources. My screen layouts "wrap content" for height so that the user always sees what information is returned from the various sources without vast areas of blank. Its an unusual design, but one that has worked well for 4+ years on many similar applications. Yup, I know that I have to be careful about heights, etc, but I'm happy to take on that responsibility.

    Eclipse is essentially creating a "Nanny State" - that's not the way we normally do it so its wrong. Pardon me but I differ in opinion.

    The way I got around this was to close the XML file and completely clean the project. This way Eclipse forgets that it ever "nanny nagged" about this issue and everything is good again.

提交回复
热议问题