9补丁不起作用

时间:2014-07-01 11:00:51

标签: android nine-patch

我创建了2 9个补丁图像,其中1个工作正常,1个不工作。试图创造它超过10次,但一切都失败了。不知道原因,这就是需要社区帮助的原因。

This is working perfect

Not working

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent" >

    <RelativeLayout
        android:id="@+id/rlContent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@id/imgPhoto"
        android:layout_marginBottom="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="10dp"
        android:layout_toRightOf="@id/imgPhoto"
        android:background="@drawable/bubble"
        android:visibility="visible" >

        <TextView
            android:id="@+id/txtMessageDate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Yesterday 4:25 PM"
            android:textColor="@android:color/black"
            android:textSize="12sp" />

        <TextView
            android:id="@+id/txtMessageSnippet"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/txtMessageDate"
            android:layout_marginTop="5dp"
            android:text="How are you?"
            android:textColor="@android:color/black"
            android:textSize="14sp" />
    </RelativeLayout>

// This is not workin - the light blue one

    <RelativeLayout
        android:id="@+id/rlContentOwner"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignBaseline="@id/imgPhotoOwner"
        android:layout_below="@id/rlContent"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="10dp"
        android:layout_toLeftOf="@id/imgPhotoOwner"
        android:background="@drawable/new_right_side_bubble"
        android:padding="0dp"
        android:visibility="visible" >

        <TextView
            android:id="@+id/txtMessageDateOwner"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="yesterday 4:37 PM"
            android:textColor="@android:color/black"
            android:textSize="12sp" />

        <TextView
            android:id="@+id/txtMessageOwner"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/txtMessageDateOwner"
            android:layout_marginTop="5dp"
            android:text="I am fine"
            android:textColor="@android:color/black"
            android:textSize="14sp" />
    </RelativeLayout>

</RelativeLayout>

1 个答案:

答案 0 :(得分:1)

你不需要这么大的补丁,因为它们会被拉伸 我重新设计了这两个:

speech_left.9.png enter image description herespeech_rite.9.png enter image description here

这是我得到的结果(我只展示了天蓝色):

enter image description here