六种颜色匡布局代码编写出来
时间: 2023-10-12 20:09:07 浏览: 91
1. 红色布局:
```xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/red">
<!-- 子视图 -->
</LinearLayout>
```
2. 橙色布局:
```xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/orange">
<!-- 子视图 -->
</LinearLayout>
```
3. 黄色布局:
```xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/yellow">
<!-- 子视图 -->
</LinearLayout>
```
4. 绿色布局:
```xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/green">
<!-- 子视图 -->
</LinearLayout>
```
5. 蓝色布局:
```xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/blue">
<!-- 子视图 -->
</LinearLayout>
```
6. 紫色布局:
```xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/purple">
<!-- 子视图 -->
</LinearLayout>
```