简体   繁体   English

内容辅助在带有支持库的xml中不起作用

[英]Content Assist doesn't work in xml with support library

I had to use Navigation Drawer from the support library v4 in my Android app. 我不得不在我的Android应用程序中使用支持库v4中的Navigation Drawer。

I linked the library with my project in eclipse. 我在eclipse中将库与我的项目相关联。 Copied it to the libs folder in my Project. 将其复制到我的项目中的libs文件夹。
Library classes are accessible to me in my java file. 我的java文件中可以访问库类。 Imports work fine. 进口工作正常。 Even the xml code that i copied from this website works fine. 即使我从这个网站复制的xml代码也能正常工作。 I didn't change any resource ids. 我没有更改任何资源ID。

The main problem is the content assist in eclipse.Its messed up when i use the DrawerLayout tag as the top parent tag. 主要的问题是eclipse中的内容辅助。当我使用DrawerLayout标记作为顶级父标记时,它会搞砸。

When i try to press ctrl + space inside any block nothing will pop up. 当我尝试在任何块内按ctrl + space时,不会弹出任何内容。

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 当我按下内部的ctrl + space时,它会显示Layout_height和layout_width等属性

android.support.v4.widget.DrawerLayout tag but will not show any result inside other tags android.support.v4.widget.DrawerLayout标记但不会在其他标记内显示任何结果

It all happens because of DrawerLayout tag being placed at the top. 这一切都是因为DrawerLayout标签位于顶部。 If i dont use it as the parent tag, everything works fine. 如果我不使用它作为父标签,一切正常。

Please Help me out! 请帮帮我!

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. 您必须了解您需要自己在strings.xml文件中定义这些颜色资源。 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 : 使用此标记定义strings.xml中的颜色:

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

Access the resource using : @color/name-of-color in your xml layout files. 使用xml layout文件中的@color/name-of-color访问资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM