Hi,

I'm trying to make a horizontal layout with two TextViews, one should
take up 40% of available width, the other 60%. This works unless the
text is longer than available space, then a stack overflow exception
is thrown. Pasting this into an empty 1.5 project xml file should
cause it (though this seems to work ok on 1.6+):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:orientation="horizontal"
  android:weightSum="100"
  >

  <TextView
    android:layout_width="0dip"
    android:layout_height="wrap_content"
    android:layout_weight="40"
    android:text="Some really long sentence AAAAA"
    android:singleLine="true"
    />

  <TextView
    android:layout_width="0dip"
    android:layout_height="wrap_content"
    android:layout_weight="60"
    android:text="Some really long sentence BBBBB"
    android:singleLine="true"
    />
</LinearLayout>

Is there some other way to do this? I need to just break a row up into
these separate columns with specific widths. I'm ok with the text just
getting truncated on overflow,

Thanks

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

Reply via email to