Questions tagged [android-gridview]

GridView is a subclass of AdapterView that displays items in a two-dimensional, scrollable grid.

GridView is a subclass of AdapterView that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using a ListAdapter. The cell-data binding is made through an Adapter.

Reference

1627 questions
7
votes
0 answers

How to have different Backgrounds and colors for dividers in GridView?

I wish to keep different colors for the divider and background in my GridView. Or I would like to hide the background color visible around the Gridview. I tried changing layout_margin & padding parameters, but that did not change anything. Following…
ambit
  • 1,099
  • 2
  • 28
  • 43
7
votes
4 answers

gridView height is too tall when using an imageView inside

I'm having an issue with the height for the cells inside the GridView. Each of my cells will have an imageView inside like so:
rycfung
  • 1,325
  • 12
  • 12
6
votes
4 answers

Duplicate items in GridView widget

UPDATE: I opened an issue, please star it if you are experiencing the same problem. http://code.google.com/p/android/issues/detail?id=28016 I have an appwidget with a gridview on it. When I start adding items to my widget, almost always I get the…
Ran
  • 4,117
  • 4
  • 44
  • 70
6
votes
1 answer

How to animate a View to hide underneath another view, and then animate from that View

I have two grid views that I would like to create a custom animation for. Imagine this layout: ___________________________________________ | | | | | TOP…
6
votes
0 answers

setShadowLayer causes slow draw time in GridView?

I'm currently working with a GridView containing ImageViews and would like shadows behind my images. There are potentially, say, 15 images visible in the grid at any time. Working under the assumption that I want my screen to render at 50fps to…
6
votes
0 answers

First item (ImageView) in a Gridview has null value for field mAttachInfo

I am writing an Android application, using a GridView to load a list of ImageView items through an Adapter. It all works fine, except the first item loaded in GridView had null value for its mAttachInfo variable. I guess it could be because the…
jason
  • 69
  • 2
6
votes
3 answers

How to display images from a external storage path in flutter?

Im basically new to flutter. I want to display Images from specific path like "Storage/WhatsApp/Media/". I want to show all the images in grid view. How can i acheive this in flutter. I have seen many examples but everyone is using assets folder.…
user8141219
6
votes
7 answers

Layout issues on different screens

I developed and tested my application the whole time on my 5.2 inch device (LG G2). Only just I started the application on a bigger 5.5 inch device (OnePlus 3T) and it looks not good as you can see below: This is the main Activity:
6
votes
0 answers

How to show an asymmetric grid of images in android

I have to show images in an asymmetric grid dynamically - setting both rowSpan(height) and colSpan(width)(Supporting Android 10+). I have tried the following approaches Approaches tried RecyclerView with GridLayoutManager With this, we can change…
6
votes
0 answers

How to add CardView inside of Gridview

I can't find the right solution. What I want is to render a GridView with CardView in each cell. For some reason I am getting this error: java.lang.NullPointerException on the fragment class, on the line that says gridView.setAdapter(adapter); Can…
Chale CS
  • 353
  • 4
  • 15
6
votes
0 answers

Dynamic Android Grid Layout with custom positioning and sizing of children

I'm currently trying to create an Android grid layout from custom elements(taken from a db) and am in need of suggestions on how to implement it. The grid should have 6 columns and it should be scroll vertically. Each Grid Element(Item) has…
6
votes
3 answers

RecyclerView GridLayout width full width and half width

Is there any way to archieve the following? I want my RecyclerView to be able to display my Cards in a grid of 2 columns, but I also want a couple of cards to have the full screen width, not just the half width. I tried using…
qwertz
  • 6,206
  • 9
  • 40
  • 62
6
votes
2 answers

Grid not expanding to fill screen

I have the following grid, which is loaded inside a StackLayout: Grid grid = new Grid { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, RowDefinitions =…
Ilia Stoilov
  • 632
  • 2
  • 11
  • 27
6
votes
4 answers

Adding Gridview to fragment it's crashing

I'm following a tutorial and trying to build in a grid view into my fragment and every time I launch the app it crashes. I opened up LogCat and it gives me nothing... Can someone help me find out what I can do to get this to display correctly and…
user1940321
6
votes
2 answers

RecyclerView - horizontal, two-row grid, second row offset

I am trying to make a horizontally scrolling grid. It has two rows. The second row is offset (by half the width of one item, but that is trivial to calculate and doesn't matter here). I am currently using RecyclerView and the GridLayoutManager…
Eric Cochran
  • 8,414
  • 5
  • 50
  • 91