You specified a height of fill_parent for both items. So they both have the height of their parent. So the second one is outside of the parent.
On Fri, Mar 20, 2009 at 6:53 PM, Meryl Silverburgh <silverburgh.me...@gmail.com> wrote: > > Hi, > > I am trying to create a compound widget which has 2 labels (i.e. > textview), one label on each line. > > public class TwoLabel extends LinearLayout { > private TextView mLabel; > private TextView mLabel2; > > public TwoLabel(Context context, AttributeSet attrs, int defStyle) { > super(context, attrs, defStyle); > > mLabel = new TextView(context, attrs, R.attr.textViewStyle); > > mLabel2 = new TextView(context, attrs, R.attr.textViewStyle); > > mLabel.setLayoutParams(new > LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, > LinearLayout.LayoutParams.FILL_PARENT)); > > > mLabel2.setLayoutParams(new > LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, > LinearLayout.LayoutParams.FILL_PARENT)); > > addView(mLabel); > addView(mLabel2); > } > > My question is why I only see the first label but not the second label? > > In the layout.xml file which uses the TwoLabel compound widget, I did this: > > <TwoLabel > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:id="@+id/textFieldLabel" > > /> > > So I am not sure why I only see the first label but not the second one. > > > > > On Fri, Mar 20, 2009 at 6:50 PM, Meryl Silverburgh > <silverburgh.me...@gmail.com> wrote: >> Hi, >> >> I am trying to create a compound widget which has 2 labels (i.e. >> textview), one label on each line. >> >> public class TwoLabel extends LinearLayout { >> private TextView mLabel; >> private TextView mLabel2; >> >> public TwoLabel(Context context, AttributeSet attrs, int defStyle) { >> super(context, attrs, defStyle); >> >> mLabel = new TextView(context, attrs, R.attr.textViewStyle); >> >> mLabel2 = new TextView(context, attrs, R.attr.textViewStyle); >> >> } >> >> } >> > > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---