Questions tagged [lazyvgrid]
131 questions
0
votes
1 answer
HTML-like table layout (i.e. auto-resizing table cells) in SwiftUI View?
I’d like to render a table of text cells in my SwiftUI View in a way, that every cell auto-resizes just so much that the text fits in it. So I did this:
import SwiftUI
struct ContentView: View {
let words = "Die Würde des Menschen…

Joe Völker
- 781
- 1
- 5
- 19
0
votes
2 answers
What is the best way to avoid accidental repeated clicks on Any btn?
My problem was accidentally repeated clicks on LazyVerticalGrid element which is resolved by using:
var enabled by rememberSaveable { mutableStateOf(true) } and val scope = LocalLifecycleOwner.current.lifecycleScope.
LazyVerticalGrid(
state…

Uladzimir
- 3
- 2
0
votes
1 answer
Assigning NavigationLink to Images within Array in Swift UI
I have an array of images that I am passing through a LazyVgrid.
I am wondering how I assign a NavigationLink to the Image names stored within the array, clicking icon1 navigates to page1, ect for all 8.
------ Swift UI -------
import SwiftUI
…

Flamee
- 35
- 8
0
votes
1 answer
SwiftUI - grid / table with column headings
I'm trying to achieve a design which essentially has the following layout:
So I need column headings for this table or grid view. The second column does not need a heading.
This seems like a job for a LazyVGrid or LazyHGrid, however I can't seem to…

DevB1
- 1,235
- 3
- 17
- 43
0
votes
1 answer
SwiftUI LazyVGrid spacing not working as expected
The following results in a grid with no vertical spacing (correct), but with 20px horizontal spacing between each item in the grid. What am I doing wrong? I don't want any spacing whatsoever in between items.
private var columnGrid: [GridItem] =…

soleil
- 12,133
- 33
- 112
- 183
0
votes
1 answer
Swiftui Navigation link not updating correctly with each individual user's page in a gridview
I am trying to achieve a view with users in a Vgrid, when a user's profile picture is tapped it should go directly to his/her profile. I have tried a lot of ways to make it work any help is needed.
When i tap on any user it goes to the first user in…

EMPIRE
- 57
- 7
0
votes
0 answers
custom scroll view is not visible inside HomeViewPage SwiftUI
Here is how CustomCardsScroll page looks like:
Preview of custom scrollView
While the contents of CustomCardsScroll is not visible to homepage as you can see from here:
HomeViewPage
Below is the code:
struct HomeView: View {
@EnvironmentObject…

DoS
- 11
- 4
0
votes
1 answer
Alert is taking wrong values inside LazyVGrid SwiftUI
Alert should remove objects from a model, but when Alert is apearing, values are not the same as a value inside tap and longPress Gesture. Any idea why?
LazyVGrid(columns: columns, spacing: 5) {
ForEach(model.robotsRepository.robots) {…
0
votes
0 answers
How to select just one Toggle in LazyVGrid
I use LazyVGrid to show set of data and as one column I'd like to use Toggle view to allow multiple lines selection. If I do it like this
ScrollView {
LazyVGrid(columns: columns) {
ForEach(data, id:\.id) { record in
…

Dawy
- 770
- 6
- 23
0
votes
1 answer
Uniform size of images inside a LazyVGrid
I'm working with a LazyVGrid with SwiftUI to display 8 images.
As you can see from the photo, the dimensions of the images are not uniform, some are exact, others have a lower height than the next photo ..
I don't understand why this happens .. Do…

kAiN
- 2,559
- 1
- 26
- 54
0
votes
0 answers
Hiding lazyvgrid item from view after button interaction and adding selected item to an array
I have a menu in which the user should select exercises from a list of which they want to include in a routine. These exercises are presented in a LazyVGrid which pops up with a sheet on interaction. This sheet gives the option to add that exercise…

fesari
- 33
- 7
0
votes
1 answer
How to detect that LazyVGrid's items get re-built?
In my app, LazyVGrid re-builds its contents multiple times. The number of items in the grid may vary or remain the same. Each time a particular item must be scrolled into view programmatically.
When the LazyVGrid first appears, an item can be…

Alexander Poleschuk
- 892
- 12
- 22
0
votes
2 answers
SwiftUI Firestore LazyVGrid Navigation Slows with more elements
I have a tab on my fitness app that shows all the fitness trainers on my app, pulled from firestore. I have noticed that when the grid is showing more than 4-5 trainers then when I tap on a trainer (navigation link to their profile) the transition…

Jake12345
- 47
- 6
0
votes
0 answers
Array of Custom Views in SwiftUI for using in ForEach
I have 4 similar views, like SettingsPointOneView() for each point in figure. They store 2 views SliderFirstPointX() and SliderFirstPointY() in this case. They (SliderFirstPointX etc...)control and change values of axis(x,y) for particular point of…

Suprafen
- 58
- 3
- 9
0
votes
2 answers
Apply color in some cells in a table
being new to swiftUI I am looking for a method to be able to apply a color in some cells of my table. For example for the category "Types", Red for "Tethered", Green for "Untethered" etc ...
I succeeded by putting values in "ForEach" but on the…

Guillaume Combot
- 25
- 4