我创建了一个新项目,设计视图为空,我拖入的任何内容activity_main.xml都不可见。

请放松这些步骤
1- Go to your res folder and inside res folder.
2-Go to values.
3-Go to style.xml
4-change <!-- Base application theme. -->
<stylename="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar">
to <stylename="AppTheme"parent="Base.Theme.AppCompat.Light.DarkActionBar">
根据CoordinatorLayout is not visible in Design view,将所有 android 库的版本更改为28.0.0-alpha1:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
我曾经有过类似的问题。更改为较低版本的 appcompat 为我解决了这个问题。
转到 build.gradle,在依赖项更改下
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
至
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
然后确保再次同步项目。祝你好运,编码愉快。