2

I'm trying to implement a simple GridLayout in Xamarin Studio, as outlined in this example:

http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-creating-a-numeric-keypad-with-gridlayout/

<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="4"
    android:orientation="horizontal" >
    <Button
        android:layout_column="3"
        android:text="/" />
    <Button android:text="1" />
    <Button android:text="2" />
    <Button android:text="3" />
    <Button android:text="*" />
    <Button android:text="4" />
    <Button android:text="5" />
    <Button android:text="6" />
    <Button android:text="-" />
    <Button android:text="7" />
    <Button android:text="8" />
    <Button android:text="9" />
    <Button
        android:layout_gravity="fill"
        android:layout_rowSpan="3"
        android:text="+" />
    <Button
        android:layout_columnSpan="2"
        android:layout_gravity="fill"
        android:text="0" />
    <Button android:text="00" />
    <Button
        android:layout_columnSpan="3"
        android:layout_gravity="fill"
        android:text="=" />
</GridLayout>

but it won't build. I'm getting the following errors:

 Error: No resource identifier found for attribute 'columnCount' in package 'android' (AndroidApplication1)
 Error: No resource identifier found for attribute 'layout_rowSpan' in package 'android' (AndroidApplication1)
 Error: No resource identifier found for attribute 'layout_columnSpan' in package 'android' (AndroidApplication1)
 Error: No resource identifier found for attribute 'layout_columnSpan' in package 'android' (AndroidApplication1)

What do I need to change to make this work?

DaveDev
  • 41,155
  • 72
  • 223
  • 385
  • did this happen after updating to rev 22 tools. If do check this http://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra/16636127#16636127 – Raghunandan May 21 '13 at 14:41
  • I have updated to rev22 but I don't know if the issue existed before that because I've only tried this example since the update. However, because I'm doing this in Xamarin (i.e. C#), I don't know if the Java Build Path applies to this issue...? – DaveDev May 21 '13 at 14:48
  • if you are using eclipse try the link in the comment – Raghunandan May 21 '13 at 14:50

1 Answers1

2

Try to add explicitly the dependency to the support:gridlayout-v7, even is you have already a dependency to the support:preference-v7.

If you are using gradle, it should looks like this in the build.gradle (Module app) : compile 'com.android.support:gridlayout-v7:23.0.+'

Olivier
  • 41
  • 4