<?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" android:orientation="vertical" android:background="@color/colorWhite" tools:context="com.hawk.cleaner.professionalcleaner.BaseMainActivity"> <!-- 阴影整体部分为竖直方向--> <LinearLayout android:layout_width="match_parent" android:layout_height="200dp" android:background="@color/colorBlue" android:orientation="vertical"> <!-- 设置图片和字体都是横向--> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginTop="20dp" android:orientation="horizontal"> <ImageView android:id="@+id/setting" android:layout_width="match_parent" android:layout_height="wrap_content" android:src="@drawable/icon_list" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:text="Facebook cleaner" android:textColor="@color/colorWhite" android:textSize="15sp" /> </LinearLayout> <RelativeLayout android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center" > <!-- 垃圾桶和右边字体都是横向的--> <LinearLayout android:id="@+id/start" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center" android:orientation="horizontal"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/garbage_cleaning" /> <!-- 可清理和下面的字设为竖直的--> <LinearLayout android
XML布局注意案例
最新推荐文章于 2024-06-26 21:36:35 发布
在进行XML布局时,要遵循先控制整体布局,再细化内部控件的顺序。特别强调要注意布局方向的正确设置,确保元素排列无误。
摘要由CSDN通过智能技术生成