android - ImageView width not matching parent -
i'm trying have 3 sections under each others using linearlayout
:
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".imageediting"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" android:orientation="vertical"> <com.google.android.gms.ads.adview android:id="@+id/adviewofediting" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="0dp" ads:adsize="banner" ads:adunitid="@string/banner_ad_unit_id" /> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical"> <imageview android:id="@+id/imageeditview" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustviewbounds="true" android:layout_margin="0dp" android:scaletype="fitxy" /> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#123456" android:gravity="center" android:orientation="horizontal"> <imageview android:id="@+id/view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/qa_gallery" /> <imageview android:id="@+id/zoom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/qa_camera" /> <imageview android:id="@+id/erase" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/qa_trash" /> <imageview android:id="@+id/crop" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/qa_view_post" /> <imageview android:id="@+id/undo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/qa_reply_comment" /> </linearlayout> </linearlayout>
all seems fine , image
of middle section , it's not matching parent size, has gaps @ left&right, other sections fine! , doing wrong here?
i tried layout , working perfect :
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" android:orientation="vertical"> <imageview android:layout_width="match_parent" android:layout_height="60dp" android:background="#343434"/> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="vertical"> <imageview android:id="@+id/imageeditview" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustviewbounds="true" android:layout_margin="0dp" android:background="#654321" android:scaletype="fitxy" /> </linearlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#123456" android:gravity="center" android:orientation="horizontal"> <imageview android:id="@+id/view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/common_ic_googleplayservices" /> <imageview android:id="@+id/zoom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/common_ic_googleplayservices" /> <imageview android:id="@+id/erase" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/common_ic_googleplayservices" /> <imageview android:id="@+id/crop" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/common_ic_googleplayservices" /> <imageview android:id="@+id/undo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/common_ic_googleplayservices" /> </linearlayout>
Comments
Post a Comment