Can someone please give me an example of an implentation of a custom view
extending a relative layout and not using XML.
For exemple the builder of mine with absolutelayout :
public VideoListRowView(Context context,int position) {
super(context);
//WARNING YOU MUST DEFINE EACH ATTRIBUTE NEEDED FOR THE CHOOSEN
LAYOUT
//ATTENTION DEFINIR IMPERATIVEMENT TOUT LES ATTRIBUTS OBLIGATOIRES
DU LAYOUT CHOISI
setLayoutParams(new
AbsoluteLayout.LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT, 0, 0));
this.setPadding(paddingLeft, paddingTop, paddingRight,
paddingBottom);
mTitle = new TextView(context);
mTitle.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
mTitle.setMaxLines(1);
addView(mTitle, new AbsoluteLayout.LayoutParams(
maxWidth - thumbailWidth,
LayoutParams.WRAP_CONTENT,xTitle,yTitle));
mTitle.setPadding(0, 0, titlePaddingRight, 0);
mSumup = new TextView(context);
mSumup.setMaxLines(3);
mSumup.setHorizontallyScrolling(false);
addView(mSumup, new AbsoluteLayout.LayoutParams(
maxWidth - thumbailWidth,
LayoutParams.WRAP_CONTENT,xSumup,ySumup);
}
My problem is to defined through Java the same behavior than you have when
you use the android:layout_toRight and android:below attribute
Thanks !
--
Fräntz Miccoli
06.70.92.76.16
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---