Cic*_*llo 2 android attributes button gradle android-studio
我在Android Studio中打开了一个空白的Android应用程序,当我尝试编辑按钮时,属性不存在。我是Android开发的新手,并跟随着一个指南,该指南显示了如何更改按钮中的文本,但属性菜单缺少该指南中的选项。
使用方法:
我更新了Gradle并做了Invalidate Caches / Restart,没有更改接口。
我的界面外观:
如何接口应该看看:
通过Android Studio的默认文件Templet创建的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>
Run Code Online (Sandbox Code Playgroud)
请首先尝试检查您的XML代码中是否存在异常!如果是,则先修复它,然后再 转到文件>无效的缓存并重新启动。重新启动后,请注意,启动需要花费更多时间,但这肯定会解决您的问题。
如果不这样使用
极端步骤
好了,有很多解决方案可以处理android studio designView渲染。
当我使用低规格系统时,在大多数情况下我曾经做过的事情是这样的
如果WINDOWS是您的操作系统,则只需执行以下步骤:
1: 如果正在运行,请关闭您的Android Studio
2: 确保bottomBar或桌面中没有快捷方式图标(可选)
3: Open C:/Users/{your_USER_NAME}/ and just delete .AndroidStudio{VERSIONCODE} folder
what does this folder do? well it saves your custom android studio themes, styles, shortcuts etc
after deleting it
4: Check you are connected to Internet
5: open the android studio and it should present you with again setting screens like what theme you would like to use etc! just go with recommended
6: follow the recommended steps at first after that if anything android studio is missing it will download!
7: try creating a new project then!
REMEMBER you do not need to remove .gradle for just simple UI/UX glitches of android studio! just remove .androidStudo3..(
| 归档时间: |
|
| 查看次数: |
2296 次 |
| 最近记录: |