android - adjust the first image view height according to second imageview -


    <relativelayout         android:layout_width="0dp"         android:layout_height="wrap_content"         android:layout_gravity="center"         android:layout_weight=".40"         android:orientation="vertical" >          <imageview             android:id="@+id/first"             android:layout_width="match_parent"             android:layout_height="160px"             android:layout_centerinparent="true"             android:padding="5dp" />          <imageview              android:id="@+id/second"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:layout_centerinparent="true"             android:background="@drawable/play_small" />     </relativelayout> 

i want set height of first imageview id --> first according second image view id -- > second. setting second image view src xml , downloading first image weblink.

you can use layoutparams task. firstly have find second imageview height, , set layoutparams of first imageview.

layoutparams params = firstimage.getlayoutparams(); params.height = secondimage.getwidth(); firstimage.setlayoutparams(params); 

hope you.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -