android - add two buttons with gridview -


i trying add 2 buttons in relative layout gridview.

but when adding second button not working crashing sometimes.

my desire design

:-enter image description here

but adding 1 button successfully. 1 button code

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent" >      <button         android:id="@+id/delete_button"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:layout_alignparentbottom="true"         android:layout_centerhorizontal="true"         android:text="delete selected image" />        <gridview         android:id="@+id/gridview1"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:layout_above="@+id/delete_button"         android:layout_alignparenttop="true"         android:columnwidth="90dp"         android:gravity="center"         android:horizontalspacing="10dp"         android:numcolumns="auto_fit"         android:stretchmode="columnwidth"         android:verticalspacing="10dp" >     </gridview>  </relativelayout>  

and getting out put this:-

enter image description here

how can add second button between grid , bottom button.

<button     android:id="@+id/delete_button"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_centerhorizontal="true"     android:text="delete selected image" />  <gridview     android:id="@+id/gridview1"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:layout_above="@+id/button1"     android:columnwidth="90dp"     android:gravity="center"     android:horizontalspacing="10dp"     android:numcolumns="auto_fit"     android:stretchmode="columnwidth"     android:verticalspacing="10dp" >  </gridview>  <button     android:id="@+id/button1"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_above="@+id/delete_button"     android:layout_alignparentright="true"     android:layout_marginbottom="22dp"     android:text="secondbutton" />  </relativelayout>  

add second button on top of first button , right

android:layout_above="@+id/delete_button" android:layout_alignparentright="true" 

enter image description here


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -