我想使用来自Android可绘制资源的1x1大小的九个补丁图像。
当我试图在我的布局xml文件中使用<ImageView>
来显示它时,这个永远不会显示在Android模拟器设备上。这里的xml代码如下:1x1尺寸9个补丁的图像没有显示在Android模拟器设备
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10px"
>
<RelativeLayout
android:gravity="center_vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:id="@+id/text_label"
android:text="@string/text"
android:textSize="10pt"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<CheckBox android:id="@+id/my_checkBox"
android:layout_alignBaseline="@id/text_label"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<ImageView android:paddingTop="10px"
android:paddingBottom="10px"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:src="@android:drawable/divider_horizontal_bright" />
</LinearLayout>
我试过另一个相同的大小,我有同样的问题,它仍然是空白。
我对Google的研究是无关紧要的。希望你能找到我在这里做错了什么。
在此先感谢您的帮助。
Lorenth
怎么样,如果你把它设置为背景?机器人:背景= “@机器人:可拉伸/ divider_horizontal_bright”。另外一项测试,如果您设置了像“#ff0000”这样的颜色,您是否会看到该行? – 2010-10-29 10:23:26
9修补图像是否仍然具有1px边框以设置可扩展区域? – roundhill 2010-10-29 12:49:21
@Mathias Lin。谢谢你回复我。通过将“src”更改为“背景”,它仍然是空白的。否则,通过使用预定义颜色设置背景可以很好地工作。这实际上很奇怪,因为它与“divider_horizontal_dark”现在运作良好,但与“divider_horizontal_bright”o_O不同,而它的尺寸相同。完全不明白为什么? – lorenth 2010-10-29 13:07:30