Android Studio?工具栏错误

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

这是我的appbar_layout.xml。根据我的定义,它应该在顶部显示一个条。但它现在显示在设计选项卡中。然而,当我在我的机器人上运行时它会显示出来。可能是什么问题?

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/main_app_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorPrimary"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

</android.support.v7.widget.Toolbar>

我的项目build.gradle

     // Top-level build file where you can add configuration options common 
     to all sub-projects/modules.

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:4.0.2'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Design Tab Screenshot

android android-studio
1个回答
0
投票

我有完全相同的问题,它似乎是Android studio 3.1.3的错误

我下载了Android studio 3.3 Canary 3,问题解决了我。

https://developer.android.com/studio/preview/

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