我是android开发的初学者。我创建了一个android项目。但是在预览部分,我看不到组件。但是当我在Emulator上运行相同的应用程序时,组件是可见的,我可以看到这些组件。我错过了一些设置?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,任何项目都将变为可见;-)
干杯
奥利万