2012-11-22 33 views
0

我正在嘗試使用jfeinstein sliding menu,該imho看起來很有前途。我喜歡與它合作的想法using the layout config,而不是代碼。我有以下非常簡單的佈局配置。使用xmlns解析XML無限制前綴時出錯:滑動

<com.slidingmenu.lib.SlidingMenu 
xmlns:sliding="http://schemas.android.com/apk/res-auto" 
android:id="@+id/slidingmenulayout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
sliding:viewAbove="@layout/customforabove" 
sliding:viewBehind="@layout/customforbehind" 
sliding:behindOffset="120dip" 
sliding:behindScrollScale="0.25" 

/>

但我得到一個錯誤,說約綁定前綴。我不知道是因爲xmlns之後滑動還是其他原因。

Tks提前!

回答

0

我認爲這應該是

xmlns:sliding="http://schemas.android.com/apk/res/auto" 

(無破折號)

並與包名在哪裏可以找到替代 「汽車」 是滑動菜單庫

嘗試:

xmlns:sliding="http://schemas.android.com/apk/res/com.slidingmenu.lib" 

而且這應該在你使用它的任何資源文件的頂部元素中(next到xmlns:android是合適的地方)

0

屬性'android:id','android:layout_width'和'android:layout_height'的名稱中的「android」也是一個名稱空間前綴,並且因此通常需要在標記中的某個地方適當填寫名爲「xmlns:android」的屬性。

0

我在一分鐘前回答了這個問題。 通過這樣做修復:

xmlns:android="http://schemas.android.com/apk/res/android" 
相關問題