Thanks Romain! That solved it! So setWidth and LayoutParam are not exactly equivalent operations?
On Nov 3, 11:17 am, Romain Guy <[EMAIL PROTECTED]> wrote: > You should try using wrap_content instead of 5dp :) > > > > On Sun, Nov 2, 2008 at 10:30 PM, Dave Kong <[EMAIL PROTECTED]> wrote: > > > I have a layout file where part of it is below. 2 TextViews nested > > inside the same FrameLayout so that the 1st one (being lower in the Z- > > order) shows up behind the text (which has transparent background). > > > <FrameLayout android:id="@+id/upper_status" > > android:layout_width="fill_parent" > > android:layout_height="wrap_content" > > android:padding="2dp"> > > <TextView android:id="@+id/player_hp" > > android:layout_width="5dp" > > android:layout_height="fill_parent" > > android:background="#ff0000"/> > > <TextView android:id="@+id/player_name" > > android:layout_width="fill_parent" > > android:layout_height="fill_parent" > > android:background="#00000000" > > android:gravity="center" > > android:text="@string/player_name"/> > > </FrameLayout> > > > My goal is to change the width of the first TextView so that it > > represents the HP of a player. But no matter what I do programatically > > (e.g. setWidth(x), measure(), requestLayout(), etc.) nothing seems to > > change the size of the TextView. > > > Can someone help? I must be missing something stupid and the > > documentation doesn't point me anywhere. > > > Thanks! > > -- > Romain Guywww.curious-creature.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

