Decrease layout_height or decrease it manually from Graphical layout. If even it does not work then you have to check whether that image's layout is overlapping with others or not. If yes then decrease that layout's size.
how to decrease height of linearlayout which is an image in android
Question
I want to decrease height of an image which is used as linearlayout in android.How can i do that? My code is as below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@android:color/transparent">
<ImageView android:id="@+id/icon"
android:layout_weight="0.15"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_gravity="center_vertical"
android:padding="5dp"
android:scaleType="fitCenter"/>
<LinearLayout android:id="@+id/details"
android:layout_weight="0.75"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<TextView
android:id="@+id/primary_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="end"
android:textSize="20dp"/>
</LinearLayout>
<ImageView
android:id="@+id/status"
android:layout_width="50dp"
android:layout_height="62dp"
android:layout_gravity="center_vertical"
android:layout_marginRight="7dp"
android:layout_weight="0.08" />
Decrease the height of imageview doesnot work.how can i do this?
Solution
OTHER TIPS
change height in this tag >> android:layout_height="100dp"
, use less number for height(80dp) or make it wrap_content
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:background="@android:color/transparent">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow