1

I need to create X numbers of linearLayout - that each linearLayout contain Text( item name ), Bitmap ( item bitmap image ).

So, i make some for loop that create dynamically linearLayout and '.addView' to out in the linearLayout the text and the Bitmap.

the problem is that the text of each item is with different text size ==> this make my UI look not good.

How can i define that the text size will be same in all the linearLayout and make the UI look good ?

1
  • I don't know what you app is exactly doing but it sound as if a ListView might solve you problem. Commented Jan 1, 2012 at 11:20

1 Answer 1

1

You can compute the largest text length, and use setWidth() method of text view object to set the width during runtime.

Alternatively, you should look into ellipsize property of text view, to put a "..." in large texts at the end. Here is the URL to ellipsize documentation: http://developer.android.com/reference/android/widget/TextView.html#attr_android:ellipsize

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.