I am running into trouble either setting up the support v7 GridLayout library in my IntelliJ project, or properly referencing it in my code.
I currently use the Acti
You only need to add the support gridlayout
to your dependencies now.
dependencies {
compile 'com.android.support:gridlayout-v7:19.1.0'
}
Then check the README
instructions located in sdk/extras/android/support/v7/gridlayout
. Most notably, you have to use the xmlns:app="http://schemas.android.com/apk/res-auto"
namespace for some of the attributes.
<android.support.v7.widget.GridLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:orientation="horizontal"
app:columnCount="8"
app:rowCount="8">
Ok, I figured this out. Turns out it was a configuration issue. Here is what I did to set up the support GridLayout library, as well as reference the classes in code.
Set up support GridLayout library in IntelliJ:
Add dependancy to project in IntelliJ:
You also need to add a reference to the support v7 GridLayout jar file in the support project libs dir.
Hopefully this helps someone else - I wasted most my day on it. =|
A little simpler solution:
First you need to add dependency to gradle anyway, so open build.gradle and
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile "com.android.support:gridlayout-v7:18.0.+"
}
This is what http://developer.android.com/tools/support-library/setup.html# but it does not seem to work fully. So then you need to make android studio recognize it.
after rebuilding project it started working for me.