dierre
dierre

Reputation: 7210

How could design this UI in Android?

This is the "prototype":

enter image description here

B1 to 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?

Upvotes: 3

Views: 362

Answers (1)

peter.bartos
peter.bartos

Reputation: 12045

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.

Upvotes: 3

Related Questions