Comments (6)
I labeled this as a bug for now. Hopefully there will be a SwiftUI update that fixes the problem. I'll keep this open so I don't forget to about it.
from swift-macos.
I added a sidebar-width
example. It uses minWidth
to define the initial width and maxWidth
to define the max width of the sidebar. Does that demonstrate what you're trying to accomplish?
from swift-macos.
Thanks! In the example I'd like to show the window with the sidebar initially set to something like 225 pt or 250 pt and still allow it to be resizable down to 200 pt and up to 300 pt.
Apps like Notes or Finder generally have the same behavior... the window shows with the sidebar width greater than the minimum and less than the maximum. I haven't figured out how to accomplish that in SwiftUI.
from swift-macos.
I understand what you're saying but I don't think it is currently possible in SwiftUI. One thing I tried was to remove .listStyle(SidebarListStyle())
from the example. This prevents the sidebar from collapsing but the nice styling effect is gone.
from swift-macos.
It's a bummer it doesn't seem to be supported in SwiftUI but thank you for taking a look! I really appreciate it!
from swift-macos.
As of macOS 13, this can be accomplished in SwiftUI with the navigationSplitViewColumnWidth
function. See the article I posted at https://gavinw.me/swift-macos/swiftui/twocol-navsplit.html for more details.
from swift-macos.
Related Issues (7)
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 swift-macos.