Android Development

layout technique

Layout technique: Center a TextView with a Button left and right

by Martin on Oct.29, 2009, under layout technique

While working on an application which should look similar to an iPhone application, I have to create a bar at the top where I have a back and a forward button (each on one side) and a dynamic text centered in the middle between them.
To get this done, I searched quite a lot and got it finally to work.
The surrounding layout should be the RelativeLayout with two Buttons (in my case I used ImageViews) and a TextView.
(continue reading…)

  • Share/Bookmark
5 Comments :, more...

Layout technique: Static elements below ScrollView

by Martin on Apr.07, 2009, under layout technique

Did you ever want to know how to place an element below a ScrollView which will normally fill the whole screen?
This is only possible by a little trick: Using margins.
The ScrollView must have positive layout_marginBottom, and the element below the ScrollView must have negative layout_marginTop.
(continue reading…)

  • Share/Bookmark
9 Comments :, more...