android - Showing incorrect imageview size in spite of correct parameters -


i have following xml display image. issue is, when page loading image view rectangle not per given sizes. how can rectify it? example need 150 x 150 rectangle per code.

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     android:orientation="vertical"     android:layout_width="match_parent"     android:layout_height="match_parent">     <tablelayout         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center"         android:layout_marginleft="2dp"         android:layout_margintop="2dp"         android:layout_marginright="2dp"         android:layout_marginbottom="2dp"         android:id="@+id/table_two">         <tablerow             android:padding="2dp"             android:layout_width="150dp"             android:layout_height="150dp">             <imageview                 android:layout_width="150dp"                 android:layout_height="150dp"                 android:layout_weight="1"                 app:srccompat="@android:drawable/picture_frame"                 android:id="@+id/ui_imageview_browse"                 android:layout_gravity="center"                 android:scaletype="fitxy" />         </tablerow>     </tablelayout> </linearlayout> 

remove part imageview

android:layout_gravity="center" 

so, imageview should follows

<imageview     android:layout_width="150dp"     android:layout_height="150dp"     android:layout_weight="1"     app:srccompat="@android:drawable/picture_frame"     android:id="@+id/ui_imageview_browse"     android:scaletype="fitxy" /> 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -