1

I'm new to android, I want the following layout(See Image Below) for my bouncing ball game. Please tell me which layout to use.


enter image description here

2 Answers 2

1

I'll use a Vertical linearLayout split into two.

Something like this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:orientation="vertical" >
        <Button
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:text="PlayingArea" />
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:orientation="horizontal" >
                <Button
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:text="left_lower_box" />
                <Button
                    android:layout_width="100dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="right"
                    android:text="right_lower_box" />
            </LinearLayout>
</LinearLayout>

This is just a sample; you'll probably not use buttons for your app and you need to set heights and widths.

Sign up to request clarification or add additional context in comments.

Comments

1

i would suggest you to use a LinearLayout with orientation vertical which is divided into two parts one for the ball to bounce and the other to design the score layout. The score layout can be designed with again a linearLayout with orientation horizantal

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.