On Sat, Dec 17, 2011 at 8: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've got several similar layouts but the warning says (emphasis mine) "This LinearLayout or its FrameLayout parent *may* be useless." I found that all of the cases in my app where the warnings said that it "is useless" were legitimate. Many of those "may be useless" cases were situations where I used layout_gravity="center", like you. I suppose there may be a more optimal layout, but in my case it isn't worth the effort to find it. Ben Ben -- 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

