Logcat警告:Drawable android:drawable / text_cursor_material具有未解析的主题属性

时间:2015-12-19 14:05:46

标签: android android-layout android-drawable android-theme

每当我点击文本字段打开键盘时,我总是会收到警告 我使用的是Android 5.0.2版 我的代码中没有使用任何drawable 我只是使用一个简单的EditText来读取数据

logcat的:

12-19 19:21:27.356 18250-18250/com.example.cook.cook W/Resources: Drawable android:drawable/text_cursor_material has unresolved theme attributes! Consider using Resources.getDrawable(int, Theme) or Context.getDrawable(int).


java.lang.RuntimeException
                                                                  at android.content.res.Resources.getDrawable(Resources.java:733)
                                                                  at android.support.v7.widget.ResourcesWrapper.getDrawable(ResourcesWrapper.java:128)
                                                                  at android.support.v7.widget.TintContextWrapper$TintResources.getDrawable(TintContextWrapper.java:70)
                                                                  at android.widget.Editor$InsertionHandleView.getHotspotX(Editor.java:3816)
                                                                  at android.widget.Editor$HandleView.updateDrawable(Editor.java:3443)
                                                                  at android.widget.Editor$HandleView.<init>(Editor.java:3434)
                                                                  at android.widget.Editor$InsertionHandleView.<init>(Editor.java:3772)
                                                                  at android.widget.Editor$InsertionPointCursorController.getHandle(Editor.java:4080)
                                                                  at android.widget.Editor$InsertionPointCursorController.access$200(Editor.java:4044)
                                                                  at android.widget.Editor.onTouchUpEvent(Editor.java:1621)
                                                                  at android.widget.TextView.onTouchEvent(TextView.java:8018)
                                                                  at android.view.View.dispatchTouchEvent(View.java:8393)
                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2173)
                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2173)
                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2173)
                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2173)
                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2173)
                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2173)
                                                                  at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
                                                                  at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2173)
                                                                  at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2317)
                                                                  at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1692)
                                                                  at android.app.Activity.dispatchTouchEvent(Activity.java:2790)
                                                                  at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
                                                                  at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
                                                                  at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2278)
                                                                  at android.view.View.dispatchPointerEvent(View.java:8583)
                                                                  at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4060)
                                                                  at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3926)
                                                                  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3483)
                                                                  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3536)
                                                                  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3502)
                                                                  at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3612)
                                                                  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3510)
                                                                  at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3669)
                                                                  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3483)
                                                                  at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3536)
                                                                  at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3502)
                                                                  at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3510)
                                                                  at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3483)
                                                                  at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5740)
                                                                  at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5714)
                                                                  at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5685)
                                                                  at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5830)
                                                                at android.view.InputEventReceiver.disp    

布局:

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textEmailAddress"

    android:ems="10"
    android:id="@+id/editTextEmail"
    android:layout_below="@+id/buttonSelectPhoto"
    android:layout_alignParentStart="true" />

有谁知道为什么会这样?

2 个答案:

答案 0 :(得分:0)

图书馆仓库有open issue

答案 1 :(得分:0)

就我而言,我在EditText xml上使用android:textCursorDrawable="@null"对其进行了修复。