1

I'm making a hangman game and i have A to Z letters in my grid view in order to guess the word. The grid view is not aligning properly it is appearing in different sizes in different mobiles what i need is the grid view should match the height of the layout. Please help me to solve this .This is the problem i'm facing Please see the image below

enter image description here

I have took a relative layout for placing the grid view in it and it appears like shown in image,for small screen mobiles its automatically providing scroll option to scroll,and in big screen mobiles it is just going above the margin. Here is the code

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:layout_marginTop="270sp"
    android:layout_marginBottom="0sp">

    <GridView
        android:id="@+id/letters"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="center"
        android:horizontalSpacing="5sp"
        android:numColumns="9"
        android:padding="5sp"
        android:stretchMode="columnWidth"
        android:verticalSpacing="5sp" />

</RelativeLayout>
Mattia Maestrini
  • 32,270
  • 15
  • 87
  • 94

0 Answers0