How to put a View in a determinate pixel/position?

You can set margins for layouts and padding for views inside them, and you can specify position relative to edges, or to other views, there. Also you can specify fixed position for layouts by replacing (match_parent/fill_parent or wrap_content) with actual size( Note that you should specify all dimensions in dp or dip) For instance you have a linear layout and you want an image view to be 20 dp to the right of the left margin you can try something like this.

You can set margins for layouts and padding for views inside them, and you can specify position relative to edges, or to other views, there. Also you can specify fixed position for layouts by replacing (match_parent/fill_parent or wrap_content) with actual size( Note that you should specify all dimensions in dp or dip) For instance you have a linear layout and you want an image view to be 20 dp to the right of the left margin you can try something like this: If you want your views to be on a certain part of the screen, like top of the screen/ bottom of the screen etc, you can nest all of them inside a RelativeLayout. This is a nice way to do it, and it will remove any confusion.

Good luck, Arkde.

I forget to say that I need to put the view programmaticall and after the interface is built. A perfect example is for example put a view similar to a ads of google admob ok? The program starts and then call to admob and admob put the ad.

The problem is that I don't have any view in my xml and I need to put the new view in a custom place like "in the 20% screen from" the top or "in the half of the screen" or perhaps in the bottom or ... How you say, the relativelayout its a posibillity but if we found a method that is more transparent to future developers – Aracem Nov 17 '11 at 15:32 1 I still think that Relative Layout remains the best practice to go, since you can handle handle screen rotation pretty easy and without any other complication. You can set relative layout parameters programmatically or inflate them to speed up your up (compiled code from xml is executed directly, and it is not interpreted ), and you can do the same for nested views :) – Arkde Nov 17 '11 at 15:42 Thank you Arkde – Aracem Nov 17 '11 at 17:10.

Gracias Narcís, Thank you Narcís, I will mix your answer and Arkde's answer to solve my problem – Aracem Nov 17 '11 at 17:09 @Aracem you're welcome! De nada! – Narcís Calvet Nov 17 '11 at 21:44.

You can use AbsoluteLayout, although it's deprecated.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions