开发者

how to get space for image(4sides) which is in listview

     <?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/linearLayout1"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:weightSum="1" android:orientation="vertical"
    android:background="#ffffff">

    <LinearLayout android:layout_height="80dp" android:id="@+id/linearLayout3"
        android:layout_width="match_parent" android:weightSum="1"
        android:layout_weight="0.02" android:background="#FFFFFF">
        <ImageView android:id="@+id/imageView1" android:src="@drawable/icon"
            android:layout_width="100dp" android:scaleType="centerCrop"
          开发者_如何转开发  android:layout_height="77dp" android:adjustViewBounds="true" android:padding="8sp"></ImageView>
        <LinearLayout android:layout_height="match_parent"
            android:id="@+id/linearLayout4" android:orientation="vertical"
            android:weightSum="1" android:layout_width="match_parent">
            <TextView android:text="TextView" android:id="@+id/textView2"
                android:gravity="left" android:padding="5dp" android:textColor="#000000"
                android:layout_height="43dp" android:layout_width="219dp"
                android:layout_weight="0.58"></TextView>

        </LinearLayout>
    </LinearLayout>
</LinearLayout>      

I have a listview in which it consists of image and text i need space for image (4sides) how can i get this can any one say the answer.

Thanks


    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:paddingLeft="16px"
        android:paddingTop="16px" android:paddingRight="16px"
        android:layout_width="fill_parent" android:layout_height="fill_parent">
        <LinearLayout android:orientation="vertical"
            android:background="#000000" android:padding="4px"
            android:layout_width="wrap_content" android:layout_height="wrap_content">
            <ImageView android:layout_width="wrap_content" 
                android:background="#FFFFFF" android:layout_height="wrap_content"
                android:paddingLeft="10px" 
                android:paddingRight="10px" 
                android:paddingTop="4px" 
                android:paddingBottom="4px" 
                 android:id="@+id/imageView3" />
        </LinearLayout>
<LinearLayout android:layout_height="match_parent"
            android:id="@+id/linearLayout4" android:orientation="vertical"
            android:weightSum="1" android:layout_width="match_parent">
            <TextView android:text="TextView" android:id="@+id/textView2"
                android:gravity="left" android:padding="5dp" android:textColor="#000000"
                android:layout_height="43dp" android:layout_width="219dp"
                android:layout_weight="0.58"></TextView>

        </LinearLayout>

    </LinearLayout>

Try this.... It's Work For me...


you can use padding..

like as android:padding="20dip"

in your case

<ImageView android:id="@+id/imageView1" android:src="@drawable/icon"
            android:layout_width="100dp" android:scaleType="centerCrop"
            android:layout_height="77dp" android:adjustViewBounds="true" android:padding="20dip"></ImageView>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜