【问题标题】:android:ime Rendering Problemsandroid:ime 渲染问题
【发布时间】:2016-04-01 02:45:07
【问题描述】:

我的 Google 登录模板有误。我使用登录活动,但在渲染/设计屏幕中总是出现以下错误:

The following classes could not be found:
- EditText (Fix Build Path)
Tip: Try to build the project.

问题是由 android:imeActionId xml 方法引起的。这是我的(谷歌)代码:

<EditText
                android:id="@+id/password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_password"
                android:imeActionId="@+id/login"
                android:imeActionLabel="@string/action_sign_in_short"
                android:imeOptions="actionUnspecified"
                android:inputType="textPassword"
                android:maxLines="1"
                android:singleLine="true" />

如果我删除所有 android:ime[...] 行,它的渲染就完美了。 我使用 Android Studio 1.5.1 和 compileSdkVersion 21

希望你能帮我解决这个问题!

干杯!

【问题讨论】:

    标签: java android xml android-edittext ime


    【解决方案1】:

    这是由于 android:imeActionId 行的误导性名称。

    它的初始值"@+id/login" 表示它正在设置自己的 id 值,但它希望您分配一个。

    请看Why does setting imeActionId with a predefined ID resource create an error?

    它提供了一个适合我的解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-19
      • 2016-06-27
      • 2010-11-29
      • 2011-11-24
      • 2016-04-21
      • 2016-07-06
      • 2011-06-05
      • 2011-05-24
      相关资源
      最近更新 更多