android - GridLayout and width -
i'm creating gridlayout number of buttons within it.
i want width of gridlayout match device screen, don't know if should menage width of gridlayout or witdhs of buttons within gridlayout.
i add together buttons gridlayout dynamically. buttons might needs more space space screen gives them! that's why don't know how menage it.
if want gridlayout match devices width set layout xml to:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".gridactivity" > <gridlayout android:id="@+id/button_grid" android:layout_width="fill_parent" android:layout_height="wrap_content" > </gridlayout> </relativelayout>
android
No comments:
Post a Comment