You are mixing a linear layout with view attributes that are used inside a relative layout.
I would change the layout to relative, and add layout_toLeftOf="right view" to the left view. Another option is to use layout_weight on the left view, and keeping the linear layout. Either way, set singleLine= true on the view you do not want to word wrap. Ellipsize=none does not prevent wrapping. -- Kostya Vasilyev 04.11.2011 2:31 пользователь "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

