加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

代码完成不适用于外部库XML属性(Android Studio)

发布时间:2020-12-16 07:52:11 所属栏目:百科 来源:网络整理
导读:我正在使用 Android Studio 1.1 RC 1. 我已将外部图书馆导入Gradle: compile 'com.rengwuxian.materialedittext:library:1.8.3' 我添加了命名空间标签: xmlns:app="http://schemas.android.com/apk/res-auto" 进入父母如下: LinearLayout xmlns:android="
我正在使用 Android Studio 1.1 RC 1.

我已将外部图书馆导入Gradle:

compile 'com.rengwuxian.materialedittext:library:1.8.3'

我添加了命名空间标签:

xmlns:app="http://schemas.android.com/apk/res-auto"

进入父母如下:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/primary_light"
    android:orientation="vertical"
    android:padding="20dp"
    tools:context="net.xxx.xxx.ui.activities.Activity"/>

我获得库内自定义视图的代码完成:

<com.rengwuxian.materialedittext.MaterialAutoCompleteTextView />

但是当我为这个视图的属性尝试代码完成时没有出现.我必须手动输入所有这些.

<com.rengwuxian.materialedittext.MaterialAutoCompleteTextView
    android:id="@+id/autocomplete"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:completionThreshold="3"
    android:hint="Enter name"
    android:imeOptions="actionDone"
    app:floatingLabel="normal"
    app:floatingLabelText="Find xxx"/>

有没有我缺少的设置或导入?

有用信息:
库中的属性文件可以在这里找到.
https://github.com/rengwuxian/MaterialEditText/blob/master/library/src/main/res/values/attrs.xml

我遇到过同样的问题.但我已经解决了.
去文件>无效缓存/重新启动…>单击无效并重新启动
这是一个有效的方式.你可以试试.

资料来源:Android Studio – Auto complete and other features not working

注意:这里还有一些其他的方法.看一看.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读