带有9个补丁的Bubble ListView

时间:2011-05-09 22:00:19

标签: android listview nine-patch

我想建立一个讨论论坛的列表视图,看起来像是在iphone中的讨论(即:handcent app)。我看到了一些例子,但没有人使用9补丁。

有没有人有一些例子?

2 个答案:

答案 0 :(得分:1)

检查一下? Why do 9-patch graphics size correctly in the emulator but not on a phone? 这家伙在9补丁上得到了一个讲话泡泡的例子。您应该尝试使用9补丁工具,它肯定会认为下次有用

答案 1 :(得分:0)

这是我的洗礼: post_list_item_even.xml

<ImageView android:id="@+id/post_icon"
    android:gravity="center_horizontal|center_vertical"
    android:padding="15dip" android:layout_width="wrap_content"
    android:layout_height="fill_parent" android:layout_alignParentTop="true"
    android:layout_alignParentBottom="true" />

<TextView android:id="@+id/post_text"
    android:gravity="center_vertical" 
    android:layout_height="wrap_content" android:layout_width="fill_parent"
    android:layout_toRightOf="@id/post_icon" android:layout_alignParentBottom="true"
    android:layout_alignParentRight="true" android:background="@drawable/forum_bubble_even" />

post_list_item_odd.xml

<ImageView android:id="@+id/post_icon"
    android:gravity="center_horizontal|center_vertical"
    android:padding="15dip" android:layout_width="wrap_content"
    android:layout_height="fill_parent" android:layout_alignParentRight="true"
    android:layout_alignParentBottom="true" />

<TextView android:id="@+id/post_text"
    android:gravity="center_vertical" 
    android:layout_height="wrap_content" android:layout_width="fill_parent"
    android:layout_toLeftOf="@id/post_icon" android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true" android:background="@drawable/forum_bubble_odd" />

希望它会有用!! :)