sdfghjkuiokp 2022-08-19 11:46 采纳率: 40%
浏览 25

Android Studio如何设置layout布局格式

img


我这里xml的风格怎么设置为Linear layout,我看别人的都是这种。

  • 写回答

3条回答 默认 最新

  • 江州司 2022-08-19 11:54
    关注

    把最外层默认的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>
    
    
    评论

报告相同问题?

问题事件

  • 创建了问题 8月19日