Comments (2)
Also, just tried to simplify this a bit, if I only have a Text() inside of the Grid, it still doesn't work:
struct ListView: View {
private let elements = ElementsModel()
@State private var showSheet = false
var body: some View {
NavigationView {
Grid(elements.elements, tracks: 3) {element in
Text("Hello")
}
.gridContentMode(.scroll)
.edgesIgnoringSafeArea(.all)
.navigationBarTitle("๐งช Elements")
.navigationBarItems(trailing:
Text("Test")
)
}
}
}
from grid.
@lorenzolewis Try to add .navigationViewStyle(StackNavigationViewStyle())
to your NavigationView
:
private struct Model: Identifiable {
let id = UUID()
}
private let models = (0..<6).map { _ in Model() }
struct NavigationExample: View {
var body: some View {
NavigationView {
Grid(models, tracks: 3) { element in
Text("Test")
.background(Color.red)
.gridCellBackground(content: { _ in Color.yellow })
}
.gridContentMode(.scroll)
//.edgesIgnoringSafeArea(.all) // I'm not sure if it's necessary
.navigationBarTitle("๐งช Elements")
.navigationBarItems(trailing:
Text("Test")
)
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
from grid.
Related Issues (20)
- Add Github Sponsor or other way to "tip" HOT 2
- Nested grid causes parent grid layout issues
- Performance issue when scroll has 1000 items and more HOT 3
- Example app not working on Apple M1 computers HOT 1
- when the item count is 0 it align to center HOT 1
- can not add views with if state of a @State boolean value HOT 2
- Change cell span dynamically HOT 1
- How do you refresh the grid? HOT 11
- Items overlap HOT 4
- Only show one item when view appear, click to restore HOT 2
- Grid lines HOT 2
- Timetable
- zIndex for Grid Items HOT 3
- TextEditor with multiple columns? HOT 1
- ScrollView Nesting Issues. HOT 5
- Top alignment for cells HOT 6
- Urgent! - 1.4.2 build fails HOT 1
- How to create columns with different view heights? HOT 1
- Does it support tvOS? HOT 1
- can support this layout? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grid.