android - How to set the percentage in screen of each fragment -
i want design divided screen 2 non equal parts in landscape mode of screen. so, thought automatically in using fragments. problem have encountered each fragment match half of screen. , that's not want exactly. want screen 2 parts non equal in width. want this:
you can make use of weight parameter.
<linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" /> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="3" /> </linearlayout>
please notice weights used 2 linearlayouts. first 1 has weight of 1 (it can occupy 1/4 th of screen) , second 1 3 (it can occupy 3/4 th of screen).
just use exact same concept fragments , maintain nay proportion wish.
hope make myself clear.
Comments
Post a Comment