我在 Android Studio 中打开了一个空白的 Android 应用程序,当我尝试编辑按钮时,属性不存在。我是 Android 开发新手,正在遵循显示如何更改按钮中的文本的指南,但属性菜单缺少指南中看到的选项。
Using:
- 安卓工作室3.2.1
- Gradle 4.6(从 4.5 更新)
- Android 插件版本 3.2.1
- Windows 10
我更新了 Gradle 并进行了“无效缓存/重新启动”操作,但没有对界面进行任何更改。
我的界面看起来如何:
界面如何should look:
类似的情况没有解决我的问题。 https://stackoverflow.com/questions/41637499/android-studio-not-showing-properties
通过 Android Studio 的默认文件模板创建的 revlavent XML 文件
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:text="@string/button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:ems="10"
android:inputType="textPersonName"
android:text="Name"
tools:layout_editor_absoluteX="181dp"
tools:layout_editor_absoluteY="337dp" />
</android.support.constraint.ConstraintLayout>
请首先尝试检查您的 XML 代码中是否存在任何异常!
如果是,那么先修复它,然后转到文件 > 使缓存无效并重新启动。重新启动后,请注意,启动需要更多时间,但这肯定会解决您的问题。
如果没有那么使用这个
极限一步
有很多解决方案来处理 android studio designView 渲染。
当我使用低规格系统时,我在极端情况下所做的事情是这样的
如果您的操作系统是 WINDOWS,则只需按照以下步骤操作:
1:如果正在运行,请关闭您的 Android studio
2:确保底部栏或桌面上没有快捷方式图标(可选)
3:打开 C:/Users/{your_USER_NAME}/ 并删除 .AndroidStudio{VERSIONCODE} 文件夹
这个文件夹有什么作用?好吧,它保存了您的自定义 Android Studio
主题、样式、快捷方式等
删除后
4:检查您是否已连接到互联网
5:打开 android studio,它应该会再次向您显示设置屏幕,例如您想要使用的主题等!只需选择推荐的即可
6:首先按照推荐的步骤进行操作,然后如果 android studio 缺少任何内容,它将下载!
7:然后尝试创建一个新项目!
REMEMBER你不需要删除 .gradle 来解决 android studio 的简单 UI/UX 问题!只需删除 .androidStudo3。.(
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)