See the section on Layout Params here: http://developer.android.com/guide/topics/ui/declaring-layout.html
I think you need to call setLayoutParams() on your image view and pass in an instance of the layout params that corresponds to the view group containing your image view. For example, if your image view is contained in a LinearLayout you would use LinearLayout.LayoutParams. Presumably the layout params you will use extend ViewGroup.MarginLayoutParams, allowing you to set the margins via the setMargins() method. On Feb 16, 10:59 pm, "sagar.indianic" <[email protected]> wrote: > Hello guys..This is urgent..can u plz help.. > > On Feb 16, 2:35 pm, Sagar Parmar <[email protected]> wrote: > > > Hello every1, > > > I want to set margin for an imageview through code. i coudnt find any method > > for that .. XML attribute is android:layout_marginLeft..what is the java > > method ?? setPadding() does not work in my case. > > Please help its urgent.. > > > Thanks in advance --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

