Hi There,
I have created RelativeLayout and added only one TextView to make
display at the center-horizantal.
However, it does not work. it always show up left-align.
Here is my code:
RelativeLayout rl = new RelativeLayout(this);
rl.setLayoutParams(new RelativeLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
TextView view = new TextView(this);
view.setHeight(40);
view.setText("Test");
RelativeLayout.LayoutParams rlp = new
RelativeLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
rlp.addRule(RelativeLayout.CENTER_HORIZONTAL);
rl.addView(view,rlp);
setContentView(rl);
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---