I see messages saying that FrameLayout is an alternative, and that I should use fields to position things (it strikes me as wildly counter intuitive, but fine ... if it works, I'll take it). However, I cannot get it to work, so I am looking for help.
here is my code
FrameLayout layout = new FrameLayout(this);
layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
Button btn = new Button(this);
btn.setBackgroundResource(R.drawable.btn);
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.setMargins(100,100,100,100);
btn.setLayoutParams(lp);
layout.addView(btn , lp);
The button is drawn at 0.0, no matter what I do. When I change lp LayoutParam to FILL_PARENT, the button is stretched to cover the entire screen (which makes sense).
How can you draw it elsewhere on the screen, no matter what else is?
As always, super grateful in advance.
[EDIT] It seems my question is not entirely clear (given the answers), so ...
, , 100 100.
, . . , , SPECIFIC. ( ). :)