Monday, April 9, 2012

Re: [android-developers] GridLayout Text Clipping using Support Library

You set the width of GridLayout to "wrap_content" so it will extend as
far as its content can go.

On Mon, Apr 9, 2012 at 10:24 AM, Scott Olcott <scottolcott@gmail.com> wrote:
> I am using the GridLayout that is in r7 of the support library.  I am having
> an issue with text being clipped at the edge of the screen instead of being
> wrapped.  Here is a layout that reproduces the issue.
>
> <android.support.v7.widget.GridLayout
> xmlns:android="http://schemas.android.com/apk/res/android"
>  android:layout_width="wrap_content"
>  android:layout_height="wrap_content" >
>
>     <TextView
>       android:minWidth="100dp"
>       android:text="test123" />
>
>     <TextView
>         android:text="test test test test tes test tes test test test test
> test test test" />
> </android.support.v7.widget.GridLayout>
>
> When using the ICS version of GridLayout I can just add
> android:layout_width="0dp" and android:layout_gravity="fill_horizontal" to
> the TextView and it wraps the text instead clipping.  However when I try
> that using the support library GridView the whole TextView disappears.  I
> attached a screenshot from the Graphic Layout view in Eclipse that
> demonstrates what is happening.  It looks like the second TextView is not
> inheriting it's size from it's container but is the same width as the
> device.
>
> Is there a different way to get this to work correctly?
>
> --
> 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

--
Romain Guy
Android framework engineer
romainguy@android.com

--
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

No comments:

Post a Comment