android - 禁用布局宽度和高度自动导入功能和建议

标签 android android-studio

如何禁用自动导入 android:layout_widthandroid:layout_height 的 Android Studio 布局编辑器功能?

我想,当我编写一些新组件时,它没有属性。

  1. 这是编写新组件时自动出现的内容。

comes

  1. 这就是我想要的

want

我想要这个是因为-

是的,所有组件都必须同时具有高度和宽度,我总是为每个组件使用我的应用程序自定义样式。

例如每个父元素都有高度和宽度match_parent,所以我只需为所有父元素 View 设置我的样式ViewParent 样式。而且我没有在任何地方指定高度和宽度。我使用样式是为了更好的可维护性。

最佳答案

转到 Android Studio 首选项 -> Editor -> General -> Smart Keys

然后取消选中 Insert required attributes on tag completion

enter image description here

关于android - 禁用布局宽度和高度自动导入功能和建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52849032/

相关文章:

android - 如何在 Android 中集成 Azure 媒体播放器

java - Android 4.4.2 不删除文件

java - Android Studio 无法从 'generated_java' 文件夹导入 java

java - 如果计数器达到特定数字,如何向按钮添加声音?

java - Android Studio 无法构建

java - 单击按钮后重复播放声音多次

android - 在默认的 AlertDialog 中居中消息

java - 将拍摄的图片转换为位图

android - ProGuard 不能与 okhttp 一起使用

android - 如何在 Android Studio 中为 android buildToolsVersion 或 targetSdkVersion 声明/配置正确的 gradle 依赖项?