把最外层默认的constraintLayout替换成Linear layout。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/activity_main"
android:background="@drawable/ic_launcher_background"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_1"
android:layout_width="200dp"
android:layout_height="200dp"
android:orientation="vertical"
android:background="#090909">
</LinearLayout>
</LinearLayout>
你这是啥问题,代码是你写的,你要啥布局啥布局。布局不是哪设的,是你自己写的代码。弱弱的问一句,咱能不能先找本书或者视频,入门了,再有问题再问?
新版本AS中使用安卓10创建项目,会默认使用最新的布局来显示的。
你自己可以直接修改的