java - How to increase the height of a view in Android Layout dynamically? -


how extend height of separated vertical line (view) dynamically in image?

this xml i'm using:

<view android:layout_width="1dp"        android:layout_height="100dp"        android:id="@+id/view_verdict"        android:background="@color/line"                    android:foregroundgravity="center_horizontal"        android:layout_alignparenttop="true"         android:layout_centerhorizontal="true" /> 

enter image description here

enter image description here

maybe example code useful (i suppose view linearlayout):

    final int newheight = 100; //this new height set in view     linearlayout.layoutparams params = new linearlayout.layoutparams(linearlayout.layoutparams.match_parent, newheight);//first param width, , second height     myview.setlayoutparams(params); 

or put:

... android:layout_height="match_parent" ... 

Comments