Large-title navigation: content top padding uses fixed estimates (64/112 dp) instead of the measured top bar height
Maintainers usually reply within 4 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- mobile-dev
Research direction
The padding is computed in Navigation.swift from hard-coded estimatedCollapsedTopBarHeight and estimatedExpandedTopBarHeight values, while the inline path already uses a measured effectiveTopBarBottomPx. Start by comparing those two code paths in that file and see how the large-title branch could read the bar's measured height instead. Done means large-title content starts at the measured bar bottom, and the Form example lines up with iOS spacing on Android.
Written by the indexing model from the issue text.
Description
Version: skip-ui 1.66.4, Skip Fuse, Android emulator (440 dpi)
What happens
With .navigationBarTitleDisplayMode(.large) (including in a sheet), the content below the MediumTopAppBar is padded using hard-coded estimates rather than the actual height of the bar. In Navigation.swift:
let estimatedCollapsedTopBarHeight = 64.dp
let estimatedExpandedTopBarHeight = 112.dp
...
let topBarHeightDp = estimatedCollapsedTopBarHeight + ((estimatedExpandedTopBarHeight - estimatedCollapsedTopBarHeight) * Float(1.0 - scrollBehavior.state.collapsedFraction))
topBarBottomDp = localSafeAreaTopDp + topBarHeightDp
The inline mode measures the bar (effectiveTopBarBottomPx); the large mode doesn't.
Consequences
- A
List/Formunder a large title starts ~40 dp lower than on iOS: the 112 dp Material bar (with its bottom padding below the title) plus the first section's header inset. On iOS the first section sits right under the large title. - The space can't be reduced from app code: shrinking the bar with
.material3TopAppBar { ... }(e.g. a customModifier.layoutthat reports a smaller height) has no effect on where the content starts, because the padding never reads the bar's height.
Steps
NavigationStack {
Form {
Section("First") { Text("Row") }
}
.navigationTitle("New item")
.navigationBarTitleDisplayMode(.large)
}
Compare the space between the title and "FIRST" on iOS and Android.
Expected
The content's top padding follows the measured height of the top bar in large mode too (as it already does in inline mode), so the bar can be customized and the content follows it. A way to set the expanded height / bottom padding of the large title would also help to match iOS spacing.
Happy to test a fix. Thanks for Skip!
- Dominant language
- Swift
- Stars
- 334
- Forks
- 95
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 8
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from skiptools/skip-ui
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 4 days
All issues in skiptools/skip-ui
Similar issues
-
AndroidAssetManager(env:peer:) in AssetURLProtocol.swift doesn't compile for Android on the Swift nightlyPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
erkamyaman/unslop-anything#579 ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
erkamyaman/rust-anything#1311 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug priority:low status:queued
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day