0
任何人都可以幫助我找到這個錯誤背後的原因??我無法弄清楚實際的問題。該應用程序沒有崩潰在我的手機,但後我更新了Play商店中的應用程序,我從crashlytics那裏獲得了錯誤報告,該應用程序因爲此錯誤而在其他某些手機上崩潰。我使用了gradient.xml作爲可繪製設置cardview和另一個佈局的漸變,請參閱我的漸變.xml,下面我無法找到此文件中的任何錯誤。任何人都可以幫助我找出問題所在?致命異常:java.lang.IllegalArgumentException半徑必須> 0
Fatal Exception: java.lang.IllegalArgumentException radius must be > 0
android.graphics.RadialGradient. (RadialGradient.java:53)
android.support.v7.widget.RoundRectDrawableWithShadow.buildShadowCorners (Unknown Source)
android.support.v7.widget.RoundRectDrawableWithShadow.setBackground (Unknown Source)
android.support.v7.widget.RoundRectDrawableWithShadow.draw (Unknown Source)
android.view.View.draw (View.java:14707)
android.widget.FrameLayout.draw (FrameLayout.java:534)
android.view.View.getDisplayList (View.java:13588)
android.view.View.getDisplayList (View.java:13635)
android.view.View.draw (View.java:14430)
android.view.ViewGroup.drawChild (ViewGroup.java:3252)
android.support.v7.widget.RecyclerView.drawChild (Unknown Source)
android.view.ViewGroup.dispatchDraw (ViewGroup.java:3070)
android.view.View.draw (View.java:14739)
android.support.v7.widget.RecyclerView.draw (Unknown Source)
android.view.View.getDisplayList (View.java:13588)
android.view.View.getDisplayList (View.java:13635)
android.view.View.draw (View.java:14430)
android.view.ViewGroup.drawChild (ViewGroup.java:3252)
android.view.ViewGroup.dispatchDraw (ViewGroup.java:3070)
android.view.View.getDisplayList (View.java:13580)
android.view.View.getDisplayList (View.java:13635)
android.view.View.draw (View.java:14430)
android.view.ViewGroup.drawChild (ViewGroup.java:3252)
android.view.ViewGroup.dispatchDraw (ViewGroup.java:3070)
android.view.View.draw (View.java:14739)
android.widget.FrameLayout.draw (FrameLayout.java:534)
android.view.View.getDisplayList (View.java:13588)
android.view.View.getDisplayList (View.java:13635)
android.view.View.draw (View.java:14430)
android.view.ViewGroup.dispatchDraw (ViewGroup.java:3070)
android.view.View.getDisplayList (View.java:13580)
android.view.View.getDisplayList (View.java:13635)
android.view.View.draw (View.java:14430)
gradient.xml
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="90"
android:endColor="@null"
android:startColor="#B3000000"
android:type="linear"/>
<corners
android:radius="1dp"/>
我確定這是因爲'android:endColor =「@ null」'。你想用這條線實現什麼?對於我來說沒有任何意義的是使用起始顏色和沒有結束顏色的漸變 –
@Vlad Matveinko:Thanx的答覆。我可以設置沒有結束顏色屬性的漸變嗎? – Gibs
這將是一個純色,而不是一個漸變,如果你這樣做。 –