android - 拖放组件在 android studio 的预览中不可见

标签 android android-layout android-studio

我是android开发的初学者。我创建了一个android项目。但在预览部分,我看不到组件。 enter image description here但是当我在模拟器上运行相同的应用程序时,组件是可见的,我可以看到组件。我这里缺少一些设置吗? 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>

最佳答案

我也遇到过这个问题,并通过仅选择另一个“主题”原因解决了它 默认主题 appTheme 不显示添加的项目。 如果您选择 Transulcent,则任何项目都会变得可见;-)

干杯 奥利万

关于android - 拖放组件在 android studio 的预览中不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51471760/

相关文章:

android - 如何自定义布局

android - 弯曲的按钮和一个圈子

android - 如何从 Eclipse 自动运行 Android 模拟器?

android - 如何在 ListView 为空时显示标题

android - 前台服务示例

android - 使用 Android Studio 的 android 项目没有运行配置

android - Android 中的屏幕录像机以编程方式,而不是屏幕截图

android - 多个 SeekBars 监听器

Android Studio 在 Linux 上运行模拟器失败

android - 在 Android Studio 中读取文件 modules.xml 失败