code完成不为外部库XML的属性(安卓工作室) [英] Code completion does not work for External Library XML attributes (Android Studio)
问题描述
我使用 Android的工作室1.1 RC 1
。
我已经导入外部库到摇篮:
I've imported an external library into Gradle:
compile 'com.rengwuxian.materialedittext:library:1.8.3'
我已经添加了命名空间标记:
I've added the namespace tag:
xmlns:app="http://schemas.android.com/apk/res-auto"
成母体如下:
into the parent as below:
<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"/>
我得到code完成对库IE中的自定义视图:
I get code completion for the custom views within the library i.e.:
<com.rengwuxian.materialedittext.MaterialAutoCompleteTextView />
但没有出现时,我尝试对这一观点的属性code完成。我必须键入这一切手动
But nothing comes up when I try code completion for the attributes for this view. I have to type all this in manually.
<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"/>
有没有设置或导入我失踪?
Is there a setting or import that I'm missing?
有用的信息: 库中的属性文件可以在这里找到。 <一href="https://github.com/rengwuxian/MaterialEditText/blob/master/library/src/main/res/values/attrs.xml">https://github.com/rengwuxian/MaterialEditText/blob/master/library/src/main/res/values/attrs.xml
Helpful Info: The attribute file in the library can be found here. https://github.com/rengwuxian/MaterialEditText/blob/master/library/src/main/res/values/attrs.xml
推荐答案
我有同样的问题。但我已经解决了它。 转到文件>无效缓存/重启...>点击在无效并重新启动 这是一种有效的方法。你可以试试。
I had the same issue. But I have solved it. Go File > Invalidate Caches / Restart... > Click at Invalidate and Restart It's an efficient way. You can try.
来源:<一href="http://stackoverflow.com/questions/18370599/android-studio-auto-complete-and-other-features-not-working">Android工作室 - 自动完成和其他功能不工作
请注意:这里有一些其他的方法了。看看吧。
Note: Here are some other approaches too. Have a look.
这篇关于code完成不为外部库XML的属性(安卓工作室)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!