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…
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…
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:…
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.…
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…
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…
benpomeroy9
  • 175
  • 1
  • 14