**
Android中加背景图的使用
**
一;
我们先创建一个新的空白工程
选择手机选项
二;
将要使用的背景图复制粘贴进旁边的mipmap文件夹中
可以直接在软件中操作
三;
改写代码
<GridLayout xmlns:android=“http://schemas.android.com/apk/res/android”
xmlns:tools=“http://schemas.android.com/tools”
android:layout_width=“match_parent”
android:layout_height=“match_parent”
android:paddingBottom=“16dp”
android:paddingLeft=“16dp”
android:paddingRight=“16dp”
android:paddingTop=“16dp”
android:columnCount=“6”
android:background="@mipmap/qq"
tools:context="com.mingrisoft.MainActivity">
<ImageView
android:id="@+id/imageview1"
android:src="@mipmap/ab"
android:layout_gravity="end"
android:layout_columnSpan="4"
android:layout_column="1"
android:layout_row="0"
android:layout_marginRight="5dp"
android:layout_marginBottom="20dp"/>
</GridLayout>
我将背景图名字命名为qq 可根据自己的意愿命名
在软件中仿真结果如上图
四;
运行在手机上效果如图