Squiggles
Squiggles

Reputation: 230

How to find LayoutParams of Android objects

This is a ridiculously simple question. I am trying to find a list of LayoutParams for an ImageButton. Again the documentation at developer.android.com is driving my insane (it has to be the worst in the known universe).

Can someone please point me at the reference that will explain/list the layoutparams.

Upvotes: 0

Views: 1498

Answers (2)

hackbod
hackbod

Reputation: 91331

There is no "list of LayoutParams for an ImageButton". An ImageButton is not a ViewGroup, so does not have LayoutParams associated with it. The LayoutParams are for the parent of the view, to tell it how it should perform layout of the view. So if you have your ImageButton inside of a LinearLayout, then the LayoutParams on it are LinearLayout.LayoutParams.

Put another way, there are an infinite number of possible LayoutParams for ImageButton, because you can make an infinite number of possible layout managers to put it in. :)

Upvotes: 4

jeet
jeet

Reputation: 29199

see, reference and let us know, what exactly you face issue in getting layout params, and to get layout params, use

view.getLayoutParams() method.

http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html

Upvotes: 1

Related Questions