Does the gridview disappear?

We use gridview to display the image and the text image.

After implementing this

1) several times the alignment seems to dance while moving the grid 2) Several times the gridview disappears.

Can you advise how to solve it?

Thanks in advance.

+8
android
source share
4 answers

@Prasath, set the layout options for your images in grid mode. Your problem will be resolved. Since the Grid view has a problem with scrolling uneven height objects. This is why your GridView disappears.

+9
source share

https://stackoverflow.com/a/4646262/2326322 # https://stackoverflow.com/questions/232819/how-to-create-a-string-in-javascript/24083737#23093437 When you set a fixed number of lines for textview inside gridItems, it no longer splits, but then there is a problem with a fixed number of lines for text. its problem is that I would like to reuse the layout for the mesh menu in more than one place, and in some I have grids with large labels with 4-5 lines, and in the main menu items there is only one line, but they must have 5 fixed lines due to other grids. I think the solution might be to measure each element in the adapter and then set layoutParams for the grid with maximum values ​​... or create several XML files for different uses of the grid.

+1
source share

This means that the base element is no longer valid; probably null reference

0
source share

I decided to replace this problem with

<LinearLayout android:orientation="horizontal" android:layout_marginTop="@dimen/big_margin" android:layout_width="match_parent" android:layout_marginLeft="@dimen/big_margin" android:layout_height="wrap_content"> 

to

 <LinearLayout android:orientation="horizontal" android:layout_marginTop="@dimen/big_margin" android:layout_width="match_parent" android:layout_marginLeft="@dimen/big_margin" android:layout_height="@dimen/workoutlist_itemheight"> 

but I don’t really know how my problem was solved.

thanks

0
source share

All Articles