英文:
How I can see Auto Attribute suggestion for Android Studio in Java
问题
XML文件在属性中不显示自动建议。我已经尝试过无效缓存/重启、删除.iml和.idea文件。我还安装了自动建议插件Codota。
这里orientation为空,不显示垂直或水平,TextView中情况也相同。
英文:
The XML file does not show auto suggestion in attribute. I have already done Invalidated catches/restart,deleted.iml and.idea file. I have also installed auto suggestion plugin codota.
Here orientation is empty, doesn't show vertical or horizontal, also same in TextView
答案1
得分: 0
为了使用自动属性,请将工具命名空间添加到每个 XML 文件的根元素中,您想要使用它们的位置,如下所示:
<app xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
英文:
To use auto attributes, add the tools namespace to the root element of each XML file where you'd like to use them, as shown here:
<app xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
专注分享java语言的经验与见解,让所有开发者获益!
评论