I want to create a grid that contains same no of columns and rows. If i assign 6 to gridview then it should generate 6 no of columns and 6 no of rows which means 36 imageviews and Gridview should not scroll down. All imageviews should fit the gridview. Size of imageviews in the grid is same (both width and height) like a calender.
Related
I am creating a recycler view and I have 2 types of itemviews in it. Each item view would have different widths(55dp for one and MatchParent for the another). If I create a recycler view with first 4 rows having width 55dp and the next 2 rows with width MatchParent, do you think my entire recycler view would have same width throughout? Or will it be 55 width for first 4 rows and MatchParent for the last 2 rows?
Please note I have set the width and height as wrapContent for the recycler view and using staggeredGridLayoutManager with single column and vertical scroll.
I only want a single column vertical scrolling recycler view with different widths at each row.
If you can imagine, it should look like an L - shaped recycler view.
Yes, it is possible to have items in RecyclerView to have different height and width.
You should give wrap content for both list item and RecyclerView
I want to create Grid view like Google plus which arranges images in variable width and height in the layout. For example say i have 7 images, and these images should be arranged in the grid view( Not in regular grid view but with variable rows and columns). These images should change their position in grid view after sometime say 5 seconds.
I am trying to use GridLayout with ImageViews. My problem is that the images I have are all different sizes. I have set the row count and column count, but somehow I need to set a fixed cell size (somehow uniform - as in cell width = total / num of columns, and cell height = total / num of rows). I want to do this so that when I set height and width of imageview to match_parent, the image view doesn't expand beyond the cell size and the layout looks uniform.
I need 5 rows and 3 columns. Can someone suggest how to do this ?
I answered a similar question here. The theory is to use a wrapper layout for your cell and provide the margins that it needs to it. Then use the imageview inside this layout. Thus the outer layout acts as a container for your imageview and it will never go out of the bound of its parent.
I want to create a grid layout that would consist of 35 cells (7 rows and 5 columns) and place 6 image views that have equal width and height in the following (row, column) cell pairs if rows and columns are zero-based:
(1,1), (1,3), (3,1), (3,3), (5,1), (5,3)
Can I create this layout using XML? How do I do that? May anyone help? Thanks.
you can do it. you have to declare a TableLayout with 7 TableRows. Then you can place empty elements where you don't want anything and your images where you want them, always keeping 5 columns in each row.
Hope it helps.
Is it possible to have a grid view with 2 columns and 3 rows with a condition
cell1 (row1,col1) spans to row2,col2 as well. ie there is no cell (row2,col1) and the cell (row1,col1) occupy its space as well
A GridView does not support spanning. A TableLayout however does. See this older topic: Android - GridView : Specify Column Span