Eclipse 的内容协助在开发 android 时做太多事情
我按照谷歌的建议使用 Eclipse 编写 Android 程序。
但是当我写 import android.
时,它自动变成 import android.R.anim;.
。
我想使用内容辅助,但这种行为很烦人。 我该如何修改它?
I use eclipse to write android programs as advice by google.
But when I write import android.
it became import android.R.anim;.
automatically.
I would like to use content assist, but this behavior is annoying.
How can I modify it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:
进入 Eclipse ->首选项
选择 Java ->编辑->内容辅助
在底部“自动激活”框中,取消选中“启用自动激活”复选框,
看看这是否对您有帮助。它将禁用自动填充,您需要按 ctrl+space 才能激活自动填充。
如果这不起作用,那么:
通过使用 Eclipse,我建议不要在导入 Android 特定类的地方编写导入。 Eclipse 足够智能,可以在您需要时建议您需要的类,并自动组织您的导入。
我编写 import 语句的唯一一次是当我导入自己编写的类并且 Eclipse 找不到它们时。
假设您需要 Android 中的 Bitmap 类。
在您的类文件中只需写入:
Eclipse 将自动建议:
并导入正确的类:
EDIT:
Go into Eclipse -> Preferences
Select Java -> Editor -> Content Assist
In the box in the bottom "Auto-Activation", uncheck the checkbox "Enable Auto-Activation"
See if this helps you. It will disabled the auto-fill, and you will need to press ctrl+space to activate the auto-fill.
If this does not work, then:
By using Eclipse I'd recommend not writing imports where you are importing android-specific classes. Eclipse is smart enough to suggest the classes you need when you need them, organizing your imports automatically.
The only time I ever write the import statements is when I'm importing classes that I've written myself and when Eclipse can not find them.
Let's say you need the class Bitmap from Android.
In your class-file just write:
And Eclipse will automatically suggest:
and import the correct class: