Content Assist doesn't work in xml with support library

放肆的年华 提交于 2019-12-10 19:28:06

问题


I had to use Navigation Drawer from the support library v4 in my Android app.

I linked the library with my project in eclipse. Copied it to the libs folder in my Project.
Library classes are accessible to me in my java file. Imports work fine. Even the xml code that i copied from this website works fine. I didn't change any resource ids.

The main problem is the content assist in eclipse.Its messed up when i use the DrawerLayout tag as the top parent tag.

When i try to press ctrl + space inside any block nothing will pop up.

When i change the values of attributes the output of the app changes. But the content assist just wont work.

It shows up properties like Layout_height and layout_width when i press ctrl + space inside

android.support.v4.widget.DrawerLayout tag but will not show any result inside other tags

It all happens because of DrawerLayout tag being placed at the top. If i dont use it as the parent tag, everything works fine.

Please Help me out!


回答1:


Well, I was doing the same thing from this website and was bounded in the same problem.

You must understand that you need to define those color resources yourself in the strings.xml file. Define your own color combination. While I understand that the tutorial must have described this but I think you are the one who can select the colors liked to you, the best.

Define the colors in strings.xml by using this tag :

<color name="name-of-color">hex-code-here</color>

Access the resource using : @color/name-of-color in your xml layout files.



来源:https://stackoverflow.com/questions/22380553/content-assist-doesnt-work-in-xml-with-support-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!