【问题标题】:Appcompact EditText give Error on click of CursorAppcompat EditText 在单击光标时给出错误
【发布时间】:2016-06-07 08:03:34
【问题描述】:

我在 TextInput 布局中使用 AppcompactEditText,如下所示。

 <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <android.support.v7.widget.AppCompatEditText
                android:id="@+id/name_et"
                style="@style/edittext"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Enter your name" />
        </android.support.design.widget.TextInputLayout>

现在我面临的问题是

当我在edittext中写入文本然后双击编辑文本时,当我点击它时它会给出移动光标它给出错误。

我的 logcat 显示如下错误:

06-07 03:58:10.856 16475-16475/com.demo E/InputEventReceiver: Exception dispatching input event.
06-07 03:58:10.856 16475-16475/com.demo E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
06-07 03:58:10.857 16475-16475/com.demo E/MessageQueue-JNI: android.view.InflateException: Binary XML file line #17: Error inflating class TextView
                                                                              at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
                                                                              at android.view.LayoutInflater.inflate(LayoutInflater.java:482)

我的 Edittext 样式:

 <style name="edittext">
    <item name="android:singleLine">true</item>
    <item name="android:focusableInTouchMode">true</item>
    <item name="android:typeface">serif</item>
    <item name="android:layout_gravity">center_horizontal</item>
    <item name="android:layout_marginTop">@dimen/margin_3dp</item>
</style>

【问题讨论】:

  • 你用compile 'com.android.support:appcompat-v7:23.0.1'了吗?
  • 在这里发布您的edittext 风格。
  • style="@style/edittext" 在哪里?
  • @IntelliJAmiya 发布了我的edittextstyle

标签: android android-appcompat


【解决方案1】:

我终于解决了这个问题。 我犯了什么错误。

我刚刚从 Apptheme 中删除 Fontfamily 和 Typeface 并解决了。

【讨论】:

    猜你喜欢
    • 2017-01-03
    • 1970-01-01
    • 2014-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多