Could someone please walk me through writing a custom Layout to give me my grid of imageViews, or point me to a good example? In particular, I can't find many resources on how I should overwrite onLayout. Thank you.
-k_day On Dec 22, 10:42 am, Greg Donald <gdon...@gmail.com> wrote: > On Mon, Dec 21, 2009 at 8:27 PM, k_day <kevin.r....@gmail.com> wrote: > > Yeah, I would like to do that. What sort of View would I parent off > > of though? AbsoluteLayout is the only type of layout that I can find > > that will allow me to assign coordinates to. > > Margins on children of a RelativeLayout behave very much like coordinates. > > RelativeLayout layout = new RelativeLayout(); > ImageView iv = new ImageView( getBaseContext() ); > > [...] > > MarginLayoutParams mlp = new MarginLayoutParams( width, height ); > mlp.setMargins( left, 0, 0, 0 ); > LayoutParams lp = new LayoutParams( mlp ); > layout.addView( iv, lp ); > > -- > Greg Donaldhttp://destiney.com/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en