我在Android Studio上導入了Circle Layout library。當我嘗試插入此代碼activity_main.xml中:無法將真實信息轉換爲可繪製的
<ru.biovamp.widget.CircleLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/white"
app:angleOffset="90.0">
<!-- Add here any views you want -->
</ru.biovamp.widget.CircleLayout>
我得到這個錯誤:
Failed to convert true into a drawable java.lang.NumberFormatException: Color value 'true' must start with # at com.android.layoutlib.bridge.impl.ResourceHelper.getColor(ResourceHelper.java:73) at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:264) at android.content.res.BridgeTypedArray.getDrawable(BridgeTypedArray.java:674) at ru.biovamp.widget.CircleLayout.<init>(CircleLayout.java:93) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:782) at android.view.LayoutInflater.inflate(LayoutInflater.java:504) at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
我可以爲了解決這個問題,怎麼辦?另外,我可以在這裏發佈哪些其他代碼來幫助解決問題?
完全activity_main.xml中:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<ru.biovamp.widget.CircleLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@android:color/white"
app:angleOffset="90.0">
<!-- Add here any views you want -->
<View android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="ok"/>
</ru.biovamp.widget.CircleLayout>
</RelativeLayout>
如果您嘗試在「CircleLayout」標籤之間添加「 」,會發生什麼情況? –
summea
2015-02-06 23:50:49
沒有任何反應,問題依然存在。 – 2015-02-07 00:09:07
我們能否讓您提供更多的代碼?例如:您的完整'activity_main.xml'和相關的「主要活動」Java代碼? – summea 2015-02-07 00:12:50