Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonnickel/fb15147353-swiftuimacostabviewcontentbehindtoolbar
https://github.com/simonnickel/fb15147353-swiftuimacostabviewcontentbehindtoolbar
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/simonnickel/fb15147353-swiftuimacostabviewcontentbehindtoolbar
- Owner: simonnickel
- Created: 2024-09-16T19:08:03.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-11-04T20:51:22.000Z (2 months ago)
- Last Synced: 2024-12-16T16:06:20.398Z (25 days ago)
- Language: Swift
- Size: 183 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FB15147353 - SwiftUI macOS: TabView content behind Toolbar
## Scenario
A SwiftUI macOS app using TabView with .sidebarAdaptable. Each Tab (sidebar entry) shows a NavigationStack with a Scrollview.
## Issue
When changing the selection, the content view appears partly hidden behind the navigation bar. Scrolling down it is visible again. It seems like the scroll view appears with a offset.
## Example codeThe example shows a SplitView with 3 entries. On Start the first content view is displayed correctly. Changing to a different item, the content shows the broken state.
![screenshot](./screenshot.png)
## Workaround
Adding `.offset(y: 1)` or `.padding(1)` on the ScrollView fixes it (`ContentView.swift:38`).
## Tested on
- Xcode Version 16.0 RC (16A242) on macOS 15.0
- Xcode Version 16.1 (16B40) on macOS 15.1 (24B83)