为什么布局设计预览未显示在我的Android Studio上? [英] Why doesn't the layout design preview get displayed on my Android Studio?

查看:109
本文介绍了为什么布局设计预览未显示在我的Android Studio上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是我还是某物,但是我无法在Android Studio的设计模式下放置简单的文本或按钮

I don't know if it's me or something but I can't place a simple text or a button in design mode in Android Studio

如果有帮助,这是代码:

If it helps, this is the code:

<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/button2"
    style="@android:style/Widget.Button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="@style/TextAppearance.AppCompat.Button"
    android:visibility="visible"
    app:layout_constraintBottom_toTopOf="parent"
    app:layout_constraintEnd_toStartOf="parent"
    app:layout_constraintHorizontal_bias="0.45"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:text="Test" />

<TextView
    android:id="@+id/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" />

推荐答案

@I_A_Mok

使用.NoActionBar(例如AppCompat.NoActionBar)将编辑器中的主题从应用程序主题更改为任何内容."

这有效!多谢! :D

and this is working! thanks a lot! :D

这篇关于为什么布局设计预览未显示在我的Android Studio上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆