If you check out the documentation for 
http://developer.android.com/reference/android/view/View.html
you will find that

"Even though a view can define a padding, it does not provide any
support for margins. However, view groups provide such a support.
Refer to ViewGroup and ViewGroup.MarginLayoutParams for further
information. "


Balwinder Kaur
Open Source Development Center
·T· · ·Mobile· stick together

The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.


On Aug 11, 11:08 pm, cindy <[email protected]> wrote:
> I need to create dynamic UI. How can I add margin to the left side of
> the button.
>
> newPost =new Button(BlogsList.this);
>             newPost.setText("Add Entry To Blog");
>             newPost.setPadding(10, 10, 10, 10);
>             newPost.setLayoutParams(new LayoutParams
> (LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
>             newPost.setOnClickListener(new NewPost(b.getName
> (),b.getBlogId()));
>             l22.addView(newPost);
>
> Thanks!
>
> CIndy
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to