That's why it's just a warning. I really depends on how the XML layout
file is used. For instance, if your XML was used in setContentView(),
you could indeed get rid of the FrameLayout. However in your
particular case, you need both. Simply ignore the warning (you can
disable it.)

On Sat, Dec 17, 2011 at 6:45 PM, Zsolt Vasvari <[email protected]> wrote:
> I have the following layout:
>
> <FrameLayout layout_width="match_parent" layout_height="wrap_content"
> minHeight="?android:attr/listPreferredItemHeight">
>   <LinearLayout layout_width="match_parent"
> layout_height="wrap_content" layout_gravity="center_vertical"
> orientation="vertical">
>      <TextView layout_width="match_parent"
> layout_height="wrap_content"/>
>      <TextView layout_width="match_parent"
> layout_height="wrap_content"/>
>   </LinearLayout>
> </FrameLayout>
>
> The idea here is that the 2 TextViews (which each could have different
> heights), are centered vertically within the possibly taller frame,
> just as you would expect in a ListView.
>
> I am getting the following Lint warning: "This LinearLayout layout or
> its FrameLayout parent is useless."
>
> I buy the warning if I could come up with an alternate non-nested
> layout that accomplished the same thing.  But I cannot, for the life
> of me, think of one using standard Android layouts.
>
> Does anybody here any ideas?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Romain Guy
Android framework engineer
[email protected]

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to