Friday, September 28, 2012

No resource identifier found for attribute 'indicator_gravity' in package ….

I was trying to porting the Tree-View-List-Android into my project recently. I have created a project called com.dotnetideas.treeview and added everything in. I can run the demo without any issue. But when I use it in another project, I kept getting “No resource identifier found for attribute 'indicator_gravity' in package com.dotnetideas.treeview” in main_demo.xml.
Here is the xml looks like.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="" xmlns:treeView=""
  android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
  <ListView android:layout_width="0dip" android:layout_height="0dip" android:scrollbars="vertical"
    android:visibility="gone"> <!-- Just to test some attributes in IDE -->
  <pl.polidea.treeview.TreeViewList android:id="@+id/mainTreeView" android:layout_width="fill_parent"
    android:layout_height="fill_parent" treeView:indicator_gravity="right|center_vertical"
    android:scrollbars="vertical" android:smoothScrollbar="true"/>
Although I followed the old code to changed the xml namespace from xmlns:treeView= to xmlns:treeView= It doesn’t seem like valid xml namespace. It turned out that the namespace needs to be xmlns:treeView="" if we reference as a library project.