Hi there,

I'm using setMargines function to specify control the UI view
position.
For some reason, only when specifying a specific margin range the UI
control view gets totally disordered.
Other values seems to work just fine... the disorders of the control
are when:
width = 50; width=50; x = (180 to 130) ; y =181; (below code for more
information)

I'm using emulator in HVGA mode Android 2.1(level 7).
Using the following I get disordered UI. Any help will be highly
appreciated!

public void onCreate(Bundle savedInstanceState)
{
       super.onCreate(savedInstanceState);
       int x,y,width,height;
       width = 50; height=50;  x = 160; y =181;
       RelativeLayout  relativeLayout =  new
RelativeLayout(getBaseContext());
       Button btn = new Button( getBaseContext() );
       btn.setVisibility(View.VISIBLE);
       Rect rect = new Rect(x,y,x+width,y+height);
       LayoutParams layoutParam = new LayoutParams(rect.width(),
rect.height());
       layoutParam.setMargins( rect.left, rect.top, rect.right,
rect.bottom );
       btn.setLayoutParams( (ViewGroup.LayoutParams)layoutParam);
       relativeLayout.addView(btn);
       this.setContentView(relativeLayout);
}

-- 
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