Ernesto Rodriguez
Ernesto Rodriguez

Reputation: 267

How to remove the padding of images into horizontal linearlayout?

I´m using the xml code for the horizontal linearlayout:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="60dip"
    android:orientation="horizontal"
    android:paddingLeft="5dip"
    android:paddingRight="5dip"
    android:layout_alignParentBottom="true"
    android:background="@drawable/back1"
    >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="60dip"
        android:clickable="true"
        android:contentDescription="@string/app_name"
        android:src="@drawable/ca_18"
        android:adjustViewBounds="true"/>
</LinearLayout>

and the ImageView have a padding top and bottom. How can I remove the padding?

Upvotes: 0

Views: 423

Answers (1)

rahul
rahul

Reputation: 6487

Avoid hardcoding the layout_height and layout_width attributes. This may look fine on your device. But may look ugly on another.

Upvotes: 2

Related Questions