2017-08-29 55 views
0

我想在Eclipse(Juno)ADT項目中沒有gradle的情況下實現android數據綁定庫。當我嘗試下佈局添加數據標籤,我得到以下錯誤 「屬性缺少命名空間前綴」在可變在Eclipse ADT項目中的Android數據綁定(無gradle)

<layout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools"> 
    <data> 
     <variable name="user" type="com.example.User"/> 
    </data> 
<LinearLayout 
    android:background="#ffffff" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:padding="@dimen/activity_horizontal_margin" 
    tools:context="com.example.exam" 
    android:orientation="vertical" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    > 
    <TextView 
     android:id="@+id/label_name" 
     android:layout_marginTop="20dp" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content" 
     android:text="CLASS NAME" 
     android:textColor="@color/colorBlue" 
     android:textSize="13sp" 
     /> 
    </LinearLayout> 
</layout> 

我認爲我沒有使用gradle產出的問題是由於建立我的項目,因此我沒有等價物的下方ADT非gradle這個項目

android { 
    .... 
    dataBinding { 
     enabled = true 
    } 
} 

誰能請我如何能利用數據對非gradle這個ADT Eclipse項目結合幫助嗎?

回答

0

gradle build確實會生成編譯時類,它會爲您綁定,所以如果您不使用gradle而Google不提供其他解決方案,則需要移至其他解決方案。

+0

我切換到android工作室,因爲我找不到任何其他選項 –

相關問題