TabView adds the status bar inset as top padding when it doesn't touch the top of the window (blank band below a view stacked above it)
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
調査の方向性
Start in Containers/TabView.swift near the reported tab entry content and Containers/Navigation.swift near topBarWindowInsets; trace how IgnoresSafeAreaLayout determines top-edge adjacency. Reproduce the issue with the supplied SwiftUI example on Android with edge-to-edge enabled, then verify both the blank band and navigation bar inset disappear when the TabView is below the banner.
索引モデルが issue の本文から書いたものです。
説明
Versions: Skip 1.9.20, skip-ui 1.66.3, skip-fuse-ui 1.19.4 (Skip Fuse), Android 16 (API 36) emulator, Pixel 9
system image; edge-to-edge (the default).
Minimal reproduction
import SwiftUI
struct ContentView: View {
var body: some View {
VStack(spacing: 0) {
// Any view above the TabView, for example a banner.
Text("Banner")
.frame(maxWidth: .infinity, minHeight: 60)
.background(Color.blue.ignoresSafeArea(edges: .top))
TabView {
Tab("One", systemImage: "house") {
NavigationStack {
Text("Content")
.navigationTitle("One")
}
}
Tab("Two", systemImage: "list.bullet") {
NavigationStack {
Text("Content")
.navigationTitle("Two")
}
}
}
}
}
}
Expected (what iOS does): the navigation bar starts directly under the banner. The banner already sits below the
status bar, so nothing below it should be inset for the status bar again.
Actual (Android): a blank band about the status bar's height appears between the banner and the navigation bar,
in the TabView's background color. The top app bar also includes the status bar inset in its own height, so the title
sits lower still.
Where it seems to come from (reading skip-ui 1.66.3):
Containers/TabView.swift, in the tab entry content (around line 501):
let topPadding = ignoresSafeAreaEdges.contains(.top) ? windowSafeDrawingInsets().asPaddingValues().calculateTopPadding() : 0.dp.
ignoresSafeAreaEdgesis[.bottom, .top]intersected withabsoluteSystemBarEdges, so it contains.top
whenever the window has a top system bar, whether or not this TabView is adjacent to the top edge.
IgnoresSafeAreaLayoutalready tracks adjacency (theedgesit passes to its content); using that here (only pad
when the TabView actually expanded into the top inset) looks like the fix.Containers/Navigation.swift(around line 495):topBarWindowInsetsisTopAppBarDefaults.windowInsetswhenever
absoluteSystemBarEdgescontains.top, again regardless of whether the stack touches the top. The same adjacency
check would avoid the second inset.
Workarounds tried: consuming WindowInsets.statusBars above the TabView removes the top bar's copy (Material 3
respects consumed insets), but not the TabView's fixed padding; safeAreaInset and safeAreaPadding are unavailable
in SkipUI, and EnvironmentValues._safeArea is internal, so app code can't mark the top edge as handled.
- 主要言語
- Swift
- スター
- 332
- フォーク
- 91
- 平均マージ
- 4日 9時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
skiptools/skip-ui のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 5 日以内に返信
skiptools/skip-ui の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
521xueweihan/HelloGitHub#4445 ·
-
comment-reshape
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
callstackincubator/ai#378 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nwverse/persona#12800 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信