拖放组件在android studio的预览中不可见 [英] Drag/Drop components are not visible in preview in android studio

查看:29
本文介绍了拖放组件在android studio的预览中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是安卓开发的初学者.我已经创建了一个 android 项目.但是在预览部分,我看不到组件. 但是当我在模拟器上运行相同的应用程序时组件是可见的,我能够看到这些组件.我在这里缺少一些设置?下面给出了 XML.

I am a beginner in android development. I have created a android project. But in the preview section, I am not able to see the components. But components are visible when i run the same app on emulator i am able to see the components. I am missing some setting here? XML is given below.

<?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 不显示添加的项目.如果您即选择半透明,则任何项目都将可见 ;-)

I've had have also this problem and solved it by only selecting another "Theme" cause the default theme appTheme doesn't show added items. If you i.e. select Transulcent, any item becomes visible ;-)

干杯奥利万

这篇关于拖放组件在android studio的预览中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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