Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 56
Android Mac Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This did the trick, thanks!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic