0
我想實現由Patrik Akerfeldt開發的android-viewflow應用程序。 源代碼是在這裏:https://github.com/pakerfeldt/android-viewflowAndroid - android.view.InflateException:錯誤膨脹類
我已經添加了「視圖流」文件夾作爲庫項目,並在我的應用程序中引用它。當我想用 「org.taptwo.android.widget.TitleFlowIndicator」,編譯器提供了以下錯誤:
「產生的原因:android.view.InflateException:二進制XML文件中的行#9 :錯誤充氣類org.taptwo.android.widget.TitleFlowIndicator「
這裏這是.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.alperen.osman.deneme"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:layout_width="fill_parent"
android:gravity="center_horizontal" android:id="@+id/header_layout"
android:orientation="vertical" android:layout_height="wrap_content">
<org.taptwo.android.widget.TitleFlowIndicator
android:id="@+id/viewflowindic" android:layout_height="wrap_content"
android:layout_width="fill_parent"
app:footerLineHeight="2dp"
app:customTypeface="fonts/Antic.ttf"
app:footerTriangleHeight="10dp" app:textColor="#FFFFFFFF" app:selectedColor="#FFFFC445" app:footerColor="#FFFFC445"
app:titlePadding="10dp" app:textSize="11dp" app:selectedSize="12dp" android:layout_marginTop="10dip" app:clipPadding="5dp">
</org.taptwo.android.widget.TitleFlowIndicator>
</LinearLayout>
<org.taptwo.android.widget.ViewFlow
android:duplicateParentState="true" android:id="@+id/viewflow"
android:layout_width="fill_parent" android:layout_height="fill_parent"></org.taptwo.android.widget.ViewFlow>
</LinearLayout>
這個部件在的.java代碼中使用如下:
...
TitleFlowIndicator indicator = (TitleFlowIndicator) findViewById(R.id.viewflowindic);
indicator.setTitleProvider(adapter);
viewFlow.setFlowIndicator(indicator);
...
我在這裏錯過了什麼?任何幫助將不勝感激。由於
使用'ADB logcat',DDMS,或在Eclipse中logcat的視角去審視logcat的,看看你的錯誤相關的** **全堆棧跟蹤。 – CommonsWare 2012-03-11 13:16:35
我已經使用了logcat DDMS並檢查了錯誤的**完整**堆棧跟蹤。然後我發佈了這個問題。 – alprncekol 2012-03-11 13:31:41
「我已經使用logcat DDMS並檢查了錯誤的完整堆棧跟蹤」 - 如果有的話,您會發現實際的異常,而不是您粘貼的那個。你貼的那個基本上說「我們有一個問題 - 繼續閱讀以找到實際的例外」。 – CommonsWare 2012-03-11 14:11:32