Saturday, December 17, 2011

[android-developers] Help with Lint Warning

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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate