This is the "prototype":
B1 to 开发者_JS百科B5 are buttons that need to be adjoining and the user has to scroll horizontally. UP and DOWN are buttons that should be always present on the screen.
I was thinking to use as external layer a classic linear layout but how do I keep UP and DOWN always there centered?
So there have to be a static background for the whole wide panel - it is like panorama metro style application. Once I've done something similar, when I needed buttons on semi transparent layout, and beneath them using RelativeLayout there was a view animator. You could do something similar:
The main Layout will be for example RelativeLayout
, it will have 3 childs. First is a HorizontalScrollView
, the second and the third are the buttons on top of the HorizontalScrollView
, aligned to the top and bottom of the screen. The HorizontalScrollView
can contain anything - for example a long LinearLayout
. I think it is possible this way...
Here is a pseudo-layout:
<RelativeLayout>
<HorizontalScrollView>
<LinearLayout>
<Button/>
<Button/>
<Button/>
</LinearLayout>
<HorizontalScrollView>
<Button/>
<Button/>
</RelativeLayout>
Where HorizonralScrollView
will fill the parent relative layout, the first Button
will be aligned to the top and will be placed over the scroll view, and the second Button
the same, but aligned to the bottom of the RelativeLayout
Both can use centerHorizontal and some padding to exact placing.
精彩评论