Skip to main content

Questions tagged [lazyvgrid]

The tag has no usage guidance.

lazyvgrid
-1 votes
0 answers
22 views

UI Freeze in SwiftUI Home View with Conditional Icon Display in LazyVGrid

I created a simple Home view that uses a LazyVGrid to display all my playlists. The UI freezes when I use an if-else statement or a switch to display different icons for the “delete mode,” “normal ...
Damiano Miazzi's user avatar
0 votes
1 answer
107 views

LazyVGrid and scrollTo issue in SwiftUI

I have encountered an issue while implementing the scrollTo mechanism for a lengthy list of products displayed using LazyVGrid in SwiftUI. Does anyone have a potential solution for this problem? Below ...
Kamajabu's user avatar
  • 496
0 votes
1 answer
58 views

SwiftUI LazyVGrid Inconsistent Item Widths Issue

I am new to SwiftUI and am learning it by making my application. I'm experiencing an issue with LazyVGrid in SwiftUI where the item widths are inconsistent. I'm trying to create a grid with a header ...
Yulia iOS's user avatar
0 votes
2 answers
59 views

LazyVGrid is not redrawn on .id() change

I'm trying to update LazyVGrid item properties when tapped and it worked on plain Ints but stopped working when numbers are wrapped in collection. code that doesn't work: import SwiftUI struct Item :...
mcx maja's user avatar
0 votes
1 answer
168 views

How can I use LazyVGrid to create flexible card widths in different rows?

I want to display three cards in a single row. However, the challenge is to make the first and last cards width larger than the other two cards within the same row. The expected output is as follows. ...
amey rane's user avatar
  • 197
0 votes
0 answers
74 views

How to make adaptive GridItem to fill in whole width with small number of items

I need to show 2-3 items horizontally if screen width allows and vertically otherwise. I thought adaptive GridItem would do the trick. It works well for portrait mode, however it doesn't fill up ...
Ruslan Mansurov's user avatar
0 votes
1 answer
71 views

Using Grid container for an array of objects

In my model, I create an array of objects: let myObjects = [ theObject(name: "first", ...), theObject(name: "second", ...), etc. I want to use the SwiftUI Grid ...
coco's user avatar
  • 3,092
0 votes
1 answer
75 views

Why buttons on a LazyVGrid are not always pressed within a Scroll view in macOS

I created a LazyVGrid within a ScrollView (vertical & horizontal). Although the layout works as I expect, when the user interacts with the window (eg: by changing its size) then button sometimes ...
George Papadopoulos's user avatar
1 vote
1 answer
237 views

ScrollView with multiple LazyVGrids jumping around when using .scrollPosition

I am using macOS. I have multiple LazyVGrid in my ScrollView. I am using .scrollPosition() to track the scroll position. Without using this modifier, I don't have any issues, but if, the scrolling is ...
Lupurus's user avatar
  • 4,049
-1 votes
1 answer
29 views

How to Get the Size of the GrideItem View in LazyVGrid or Showing a Number Near the Corner of a View

I have a bunch of Buttons in LazyVGrid as shown in the picture below. I want to show a number near the top-left corner of a button. For a particular iOS device model, I can just offset the position ...
El Tomato's user avatar
  • 6,667
0 votes
2 answers
258 views

Memory allocation issue with SwiftUI’s LazyVGrid when displaying media files

I’m currently working on a SwiftUI application that displays media files in a grid with LazyVGrid on GalleryView where there will be 3 media files per row. The media files are loaded from the app's ...
swiftenjoyer's user avatar
0 votes
0 answers
22 views

Custom Lazy Grid list lags

I want to create custom implementation of LazyVerticalGrid. I've already done it but the scrolling list exhibits slight intermittent interruptions during movement. I can't see any additional ...
Wafi_ck's user avatar
  • 1,288
0 votes
1 answer
63 views

LazyVGrid produces different vertical spacing with different custom heights

I have LazyVGrid and inside I have a custom view that can changes it's height based on the image ratio the description etc ... the grid is sizing the view correctly but then the vertical spacing ...
tara tandel's user avatar
0 votes
1 answer
38 views

Context menu responds to random locations

Here is the snippet of the code which creates this list: ScrollView { LazyVGrid(columns: columns, alignment: .leading, spacing: 8) { ForEach(viewModel.previews) { item in ...
Maysam's user avatar
  • 7,327
0 votes
2 answers
80 views

LazyVGrid ignores the leading padding of the first element

struct HomeView: View { @ObservedObject var viewModel = CarViewModel() let columns = Array(repeating: GridItem(.flexible(), spacing: 20, alignment: .center), count: 2) var body: some View { ...
Tayfun Sağdıç's user avatar

15 30 50 per page
1
2 3 4 5
11