开发者

ListView TextView Items have a big gap between each entry

I'm having a difficult time lining up my text views directly underneath each other. The problem I'm facing is lining up my second TextView "prodlocation" underneath "prodname". I have a big gap between the two items. Ive tried "layout_gravity="top"" but the gap is still there. Is there a better way to accomplish this?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/myselector">


    <com.github.droidfu.widgets.WebImageView
        android:id="@+id/productimg"
        android:adjustViewBounds="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="fill_parent">
        <TextView
            android:id="@+id/prodname"
            android:textColor="@drawable/selected_text"
            android:textStyle="bold"
            android:paddingLeft="10dip"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" 
            android:singleLine="true"
        />
        <TextView
            android:id="@+id/prodlocation" 
            android:textColor="@drawable/selected_text"
            android:layout_gravity="top"            
            android:paddingLeft="10dip"
            android:layout_width="fill_parent"
            android:layout_height="0dip" 
            android:singleLine="true"
        />        
        <TextView
            android:id="@+id/prodorigin" 
            android:textColor="@drawable/selected_text"            
            android:paddingLeft="10dip"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="2" 
            android:singleLine="true"
        />
        <TextView
            android:id="@+id/savings" 
            android:textColor="@drawable/selected_text"            
            android:paddingLeft="10dip"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="2" 
            android:singleLine="true"
        />                
        <TextView
            android:id="@+id/price"
            android:textColor="@drawable/selected_text"
            android:paddingLeft="10dip"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="3" 
            android:singleLine="true"
        />        
    </LinearLayout>

    <ImageView 
        android:id="@+id/throbber"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        开发者_开发问答android:src="@drawable/ic_popup_sync_1"
        android:visibility="gone"
    />

</LinearLayout>


Try to remove the layout_weight="1" of your prodName TextView.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜