材料设计未显示在新的“空活动”模板应用上

问题描述 投票:1回答:1

我正在努力学习Android开发。我点击了“空活动”模板,它显示了一个带有后退按钮的精美材质工具栏。但是,当我查看主布局xml文件时,我看不到它。难道我做错了什么?它应该是这样的吗?教程显示与我的不同:

教程显示材质工具栏:

enter image description here

我没有表现出什么:enter image description here

这是我复制问题的视频: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>
android-studio android-layout material-design android-xml
1个回答
4
投票

你必须点击eye图标/按钮,然后选择"Show Layout Decorations"

Preview

© www.soinside.com 2019 - 2024. All rights reserved.