Giter Site home page Giter Site logo

Comments (6)

wigging avatar wigging commented on July 18, 2024 1

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.

wigging avatar wigging commented on July 18, 2024

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.

briantkelley avatar briantkelley commented on July 18, 2024

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.

wigging avatar wigging commented on July 18, 2024

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.

briantkelley avatar briantkelley commented on July 18, 2024

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.

wigging avatar wigging commented on July 18, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.