有许多有用的链接,这里描述了如何在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他们两个?
非常感谢。有用。 –