自定义UI库无法在项目中工作

时间:2014-04-24 05:56:40

标签: java android xml user-interface

我在项目中添加了一个库。但是,当我使用库提供的任何视图时,它会给我unbound prefix error。我在我的xml文件中添加了命名空间,但我仍然收到此错误。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:wingokuFlatUI="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
 >


     <com.wingoku.flatUI.WinGokuFlatButton

        android:id="@+id/wingoku3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="wingoku"
        android:textColor="#fff"
        wingokuFlatUI:normalStateColor="#EB974E"
        wingokuFlatUI:pressedStateColor="#F2784B" />



</RelativeLayout>

更新

进行一些更改后,现在我收到此错误

Multiple annotations found at this line:
    - error: No resource identifier found for attribute 'normalStateColor' in package 
     'com.example.android_flatui_testing'
    - error: No resource identifier found for attribute 'pressedStateColor' in package 
     'com.example.android_flatui_testing'

我可以对代码进行哪些更改以消除此错误?

此致

2 个答案:

答案 0 :(得分:0)

您定义的命名空间为flatUI,之后您正在使用flatui。我认为你应该在两个实例中使用相同的字符大小写。

答案 1 :(得分:0)

我之前发现了这个website ......

他们实现了添加xml的示例:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:wingokuFlatButton="http://schemas.android.com/apk/res/com.wingoku.flatUI"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
 >