Have you tried with layout-weight?

2011/11/3 darrinps <[email protected]>

> I have two TextViews. One to the left of the other. The first can hold
> a very long name and the other is pretty much fixed in width.
>
> If the name is very long I want it to wrap to the next line but I
> cannot seem to get it to do the wrapping. It's always the second
> TextView that wraps.
>
> I've tried about everything I could find on the Internet as a
> suggestion and nothing works. Any ideas?
>
> Here is the stripped down version. I removed all of the things I tried
> to get it to wrap correctly.
>
> Thanks!
>
>
>        <LinearLayout
>                android:id="@+id/layout_passport_name"
>                android:background="#e3e9f2"
>                android:orientation="horizontal"
>                android:layout_width="fill_parent"
>                android:layout_height="wrap_content">
>
>                <TextView
>                        android:id="@+id/name_on_passport"
>                        android:text="Johnneylongname Withalonglastnametoo"
>                        android:textColor="#022750"
>                        android:textStyle="bold"
>                        android:ellipsize="none"
>                        android:scrollHorizontally="false"
>                        android:layout_centerVertical="true"
>                        android:layout_alignParentLeft="true"
>                        android:layout_width="wrap_content"
>                        android:layout_height="wrap_content"
>                />
>
>                <TextView
>                    android:id="@+id/some_id"
>                        android:text="Member number 1 of 3"
>                        android:textColor="#022750"
>                        android:textStyle="bold"
>                        android:ellipsize="none"
>                        android:scrollHorizontally="false"
>                        android:paddingLeft="10px"
>                        android:layout_gravity="right|center_vertical"
>            android:layout_alignParentRight="true"
>            android:layout_width="wrap_content"
>                        android:layout_height="wrap_content"
>                />
>
>        </LinearLayout>
>
> --
> 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

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