How to set margins for ImageButtons in a GridView?
<p>I have a GridView populated with ImageButtons at runtime.   Some buttons are smaller than others and they hug the top of their row;  I want them centered in their row.   I think I could accomplish this with a margin (or maybe even gravity) but programmatically I don't see any way to do this.</p>

<p>The usual advice is to use LayoutParams, but the layout params available via GridView's LayoutParams are very limited and don't include margin or gravity.   </p>

<p>Thanks in advance for any suggestions!</p>
