fix(iOS): fix lock overlay ZStack order — icon now above overlay, unlock shows toolbar

This commit is contained in:
yumoqing 2026-07-02 22:20:26 +08:00
parent 01116180d1
commit d519e9aa17

View File

@ -454,8 +454,13 @@ struct PlayerContentView: View {
lastInteraction = Date() lastInteraction = Date()
if isLocked { if isLocked {
isLocked = false isLocked = false
withAnimation(.easeInOut(duration: 0.25)) {
showToolbar = true
}
resetHideTimer()
} else { } else {
isLocked = true isLocked = true
showToolbar = false
} }
#else #else
withAnimation(.easeInOut(duration: 0.25)) { withAnimation(.easeInOut(duration: 0.25)) {
@ -466,6 +471,19 @@ struct PlayerContentView: View {
} }
) )
// iOS
#if os(iOS)
if isLocked {
Color.black.opacity(0.01)
.ignoresSafeArea()
.allowsHitTesting(true)
.contentShape(Rectangle())
.onTapGesture {
//
}
}
#endif
// 30 // 30
VStack { VStack {
Spacer() Spacer()
@ -489,19 +507,6 @@ struct PlayerContentView: View {
.transition(.move(edge: .bottom).combined(with: .opacity)) .transition(.move(edge: .bottom).combined(with: .opacity))
} }
} }
// iOS
#if os(iOS)
if isLocked {
Color.black.opacity(0.01)
.ignoresSafeArea()
.allowsHitTesting(true)
.contentShape(Rectangle())
.onTapGesture {
//
}
}
#endif
} }
.onAppear { .onAppear {
#if os(macOS) #if os(macOS)