mirror of
https://github.com/yattee/yattee.git
synced 2026-04-10 17:46:58 +00:00
Fix ContentUnavailableView centering on Apple TV
On tvOS, ContentUnavailableView inside a Group doesn't expand to fill available space — it sizes to content and aligns top-leading. Add .frame(maxWidth: .infinity, maxHeight: .infinity) to all instances so they center correctly in their parent containers.
This commit is contained in:
@@ -180,12 +180,14 @@ struct BookmarksListView: View {
|
||||
private var emptyView: some View {
|
||||
if !searchText.isEmpty {
|
||||
ContentUnavailableView.search(text: searchText)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
ContentUnavailableView {
|
||||
Label(String(localized: "home.bookmarks.title"), systemImage: "bookmark")
|
||||
} description: {
|
||||
Text(String(localized: "home.bookmarks.empty"))
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@ struct ContinueWatchingView: View {
|
||||
} description: {
|
||||
Text(String(localized: "home.continueWatching.empty"))
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
|
||||
private var listContent: some View {
|
||||
|
||||
@@ -206,12 +206,14 @@ struct HistoryListView: View {
|
||||
private var emptyView: some View {
|
||||
if !searchText.isEmpty {
|
||||
ContentUnavailableView.search(text: searchText)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
} else {
|
||||
ContentUnavailableView {
|
||||
Label(String(localized: "home.history.title"), systemImage: "clock")
|
||||
} description: {
|
||||
Text(String(localized: "home.history.empty"))
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ struct PlaylistsListView: View {
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
|
||||
// MARK: - List Content
|
||||
|
||||
Reference in New Issue
Block a user