0

So i'm getting an @string error as well as an API level error. Any suggestions? ive tried changing the xmlns, but still nothing to get rid of the error.

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:columnCount="2"
android:orientation="horizontal" >

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/News" >

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:text="Workouts" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Videos" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Blog" />
</Button>

0

1 Answer 1

2

A Button is a view and canot be used as ViewGroup. You put 3 Buttons inside a Button node, it's not correct.

But in your words, you meet the api level error. GridLayout is added since API level 14 and cannot be used in lower level. You should add support library to enable it, try to read the same question for answer.

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

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.