有許多有用的鏈接,這裏描述瞭如何在android中爲佈局添加邊框,還有其他人描述瞭如何將圖像添加爲佈局的背景。但他們正在單獨工作。 我在我的應用程序中有一個textview,我想添加一個背景圖像到它,也是一個邊框。
我周圍搜索,但沒有找到任何東西。
這裏是我的XML文件中的單獨代碼:
背景圖像:將圖像和邊框添加到Android中的佈局
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/TitlePattern"
android:tileMode="repeat" />
邊框:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="2dip" android:color="#635E5E" />
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>
我怎樣才能把我的TextView他們兩個?
非常感謝。有用。 –