GeeCON Prague 2014*
The moose likes Android and the fly likes how to put button inside a SurfaceView and on the bootom of the screen? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Android
Bookmark "how to put button inside a SurfaceView and on the bootom of the screen?" Watch "how to put button inside a SurfaceView and on the bootom of the screen?" New topic
Author

how to put button inside a SurfaceView and on the bootom of the screen?

Dov Ezra
Greenhorn

Joined: Nov 23, 2010
Posts: 21
Hello all,

I want to build a ui layout that have a full screen surface view and some buttons at the bottom of it.

All I managed to do is is to put a relative layout below a surface view and the buttons inside the relative view.
this way they are at the bottom, but I lost a portion of the screen area.



Also, I tried to put use a RelativeView contains the SurfaceView followd by the buttons. this way the surface fill the screen, but the buttons are on top of the screen.
I didn't manage to move them down using android:gravity="bottom".

any Ideas?
Dov
Misha van Tol
Ranch Hand

Joined: Jan 02, 2010
Posts: 56

I would try something like this, a LinearLayout with the SurfaceView (height: 0dp and weight: 1 to give it all space that's left over)
and another LinearLayout which has the buttons who each have a width: 0dp and a weight: 1 so they are equally divided.

Dov Ezra
Greenhorn

Joined: Nov 23, 2010
Posts: 21
This did the trick, thanks!
 
GeeCON Prague 2014
 
subject: how to put button inside a SurfaceView and on the bootom of the screen?