Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ: Getting GridLayout work

I try to use GridLayout in my App, but it wont work. I used this Tutorial: IntelliJ and android.support.v7.widget.GridLayout

But it still wont work.

I get the following Error:

error: No resource identifier found for attribute 'columnCount' in package 'android'
error: No resource identifier found for attribute 'rowCount' in package 'android'

Any further tips?

EDIT: work with my actual XML:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:grid="http://schemas.android.com/apk/res-auto"
              android:layout_width="350dp"
              android:layout_height="fill_parent"
              android:orientation="vertical">

    <EditText android:layout_height="wrap_content"
              android:layout_width="fill_parent"
              android:cursorVisible="false"
              android:id="@+id/txtName"/>


    <android.support.v7.widget.GridLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            grid:columnCount="3"
            grid:rowCount="2">

        <TextView   
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="1,1" />
     
    </android.support.v7.widget.GridLayout>

</LinearLayout>
like image 268
Prexx Avatar asked Oct 31 '12 14:10

Prexx


1 Answers

Today I struggled with this and on android dev site I found simpler solution and why they're problems with it. GridLayout from v7 libraries aren't connected with v7 appcompat library so you must add v7 gridlayout library dependency manually.

If you use gradle then in build.gradle just add

dependencies {
    ...
    compile 'com.android.support:gridlayout-v7:23.2.0'
}

and everything should works fine :)

like image 70
wrozwad Avatar answered Nov 03 '22 22:11

wrozwad