将工具:showIn =“ @ layout / activity_main”添加到约束布局时无法看到Android Studio设计视图

大家好,我只是在这里尝试Android开发。我添加了新的约束布局,并在设计中添加了一些控件。不幸的是,我看不到任何添加的按钮。我只能看到主要布局中的内容。这是我的布局打开标签

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:id="@+id/tab1_fragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".Mainactivity"
    tools:showIn="@layout/activity_main"
    > 

但是,如果我删除行

tools:showIn="@layout/activity_main"

然后它向我显示了没有背景的控件。如何使元素在背景中可见?提前致谢。

zwm454 回答:将工具:showIn =“ @ layout / activity_main”添加到约束布局时无法看到Android Studio设计视图

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3144330.html

大家都在问