android UI布局
生活随笔
收集整理的這篇文章主要介紹了
android UI布局
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、設置反復背景
在drawable目錄下建一個mybackground.xml文件 在文件里寫入: <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/mybg_img" android:tileMode="repeat"/>
在drawable目錄下建一個mybackground.xml文件 在文件里寫入: <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/mybg_img" android:tileMode="repeat"/>
tileMode 屬性就是用于定義背景的顯示模式:?
? ? ? ? disabled 默認值。表示不使用平鋪
? ? ? ? clamp 復制邊緣色彩
? ? ? ? repeat X、Y 軸進行反復圖片顯示,也就是我們說要說的平鋪?
? ? ? ? mirror 在水平和垂直方向上使用交替鏡像的方式反復圖片的繪制
二、使用layer-list組合圖片
相同的在drawable目錄下建一個mylayerlist.xml文件
在文件里寫入:
<?
xml version="1.0" encoding="utf-8"?>?
<layer-list?xmlns:android="http://schemas.android.com/apk/res/android">?
<item>?
? ? <bitmap android:src="@drawable/sms_top_bg"?
? ? ? ? android:gravity="center"/>?
</item>?
<item>?
<bitmap android:src="@drawable/sms_list_selected_arrow"?
android:gravity="right"/
posted @ 2017-07-25 15:48 zsychanpin 閱讀(...) 評論(...) 編輯 收藏轉載于:https://www.cnblogs.com/zsychanpin/p/7234551.html
總結
以上是生活随笔為你收集整理的android UI布局的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Project 3 :Python爬虫源
- 下一篇: 多个圆点,鼠标选取两个,求两个点的距离,