Questions tagged [lazyhgrid]
6 questions
2
votes
1 answer
How to make SwiftUI Text multilineTextAlignment start from Top and Center
How can I make the image and text alignment same as 3 other in SwiftUI LazyVGrid as I expected in image below?
I think the problem is how to make the text start from top if the text is multiline. In Android I can use gravity="top|center" but in…
![](../../users/profiles/5815210.webp)
doema
- 237
- 2
- 6
2
votes
1 answer
SwiftUI: How to make GridItem pushing out to fill the available space
I would like to create a grid with 24 Items in 4 rows, so each row should have 6 items. All items should be equally sized but fill the whole space available, no matter what device the grid is rendered on.
I already achieved a flexible height for the…
![](../../users/profiles/3143890.webp)
LukeSideWalker
- 5,686
- 2
- 25
- 38
1
vote
0 answers
Is it possible to build a simple collection of flexible Views in SwiftUI using Grid?
What I'm trying to build is really very simple and common component. Here's the design:
Here's the code that I've tried till now:
struct ContentView: View {
var tags: [String]
var body: some View {
LazyVGrid(columns:…
![](../../users/profiles/7098650.webp)
Frankenstein
- 13,516
- 4
- 12
- 38
1
vote
2 answers
Problem with formatting LazyHGrid - SwiftUI
I am trying to create a basic lazyHGrid but after looking at a couple of different tutorials online I still can't manage to build it properly. I am trying to make a grid that is filled with rectangles with symbols and text inside those rectangles.…
![](../../users/profiles/8157387.webp)
spoax
- 271
- 7
- 20
0
votes
1 answer
SwiftUI How do I record the index of the grid item that is currently being displayed on CollectionView?
I am trying to have a scrolling horizontal list of items, where each item takes up almost the full screen width (UIScreen.main.bounds.width - 50). There should be just enough of the next item visible for the user to know there is something to…
![](../../users/profiles/15276478.webp)
Crystal
- 26
- 6
0
votes
1 answer
Building a lazy grid with rows and columns - SwiftUI
I am wanting to create a view in my app which acts basically as a table. I believe a lazy grid is the best way to do this in iOS 14, I'm just not sure what I am doing with them. The sort of table I want to create is pictured below:
Each of the rows…
![](../../users/profiles/12969913.webp)
benpomeroy9
- 175
- 1
- 14