Material 设计未在新的 "Empty Acitivity" 模板化应用中显示
Material design not showing on new "Empty Acitivity" templated app
我正在努力学习 Android 开发。我正在单击 "Empty Activity," 的模板,它显示了一个带有后退按钮的漂亮 Material 工具栏。但是,当我查看主布局 xml 文件时,我没有看到它。难道我做错了什么?它应该是这样的吗?本教程显示的内容与我的不同:
教程显示 Material 工具栏:
我的没有显示:
这是我重现问题的视频:https://imgur.com/a/6fMaCki
这是 Android Studio 为我创建的 activity_main.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">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
您必须单击 eye
icon/button 并选择 "Show Layout Decorations"
我正在努力学习 Android 开发。我正在单击 "Empty Activity," 的模板,它显示了一个带有后退按钮的漂亮 Material 工具栏。但是,当我查看主布局 xml 文件时,我没有看到它。难道我做错了什么?它应该是这样的吗?本教程显示的内容与我的不同:
教程显示 Material 工具栏:
我的没有显示:
这是我重现问题的视频:https://imgur.com/a/6fMaCki
这是 Android Studio 为我创建的 activity_main.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">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
您必须单击 eye
icon/button 并选择 "Show Layout Decorations"