找到一张合适的图片,将其设置为png格式,添加到drawable-hdpi目录下 设置layout的属性,假设工程为Mytest,修改文件为Mytest/res/layout/activity_main.xml: <RelativeLayout 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:layout_gravity="center" android:background="@drawable/bg" //将背景图片添加进去 android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 09:52
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.