contrl_index_top_bar_bg.xml
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/contrl_top_bar_bg" android:tileMode="repeat" />
调用
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="9" android:background="@drawable/contrl_index_top_bar_bg" > </RelativeLayout>
实际上在 android 中, 即便 直接
android:background
=
"@drawable/contrl_top_bar_bg"
也可以达到效果,
区别是, 直接 加载图片 为背景会将 图片 以一定比例 显示完整即会被拉伸, 加载 style 的话则 以原有布局的大小不变,图片
大小不变 镶嵌其中,会出现repeat效果类似 HTML 里面的 CSS 背景图片