开发者

listview item text allignment

I have a list layout with 9patch .png used for each item - I have a small text allignment issue as in the attached pic.

Any ideas how to solve it?

Here is the first entry layout

<?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="wrap_content" 
        android:background="@drawable/list_up" >
    <TextView
        android:id="@+id/listUp_RecipeIngredientNameTextBoxId"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="14dip" />

</LinearLayout>

Here开发者_C百科 is the 2nd entry layout

<?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="wrap_content" 
        android:background="@drawable/list_middle" >
    <TextView
        android:id="@+id/listMiddle_RecipeIngredientNameTextBoxId"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="14dip" />

</LinearLayout>

listview item text allignment


Assuming list_middle and list_up are 9patch drawables, the difference should be in the "padding" specified in the 9patch images. You can solve this making both 9patch have the same amount of pixels in the borders (ie the width of the "left" part of the 9patch and the height of the "top" part of the 9patch).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜