On Mon, Dec 21, 2009 at 8:27 PM, k_day <[email protected]> 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 Donald
http://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 [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