fix(iOS): fix lock overlay ZStack order — icon now above overlay, unlock shows toolbar
This commit is contained in:
parent
01116180d1
commit
d519e9aa17
@ -454,8 +454,13 @@ struct PlayerContentView: View {
|
||||
lastInteraction = Date()
|
||||
if isLocked {
|
||||
isLocked = false
|
||||
withAnimation(.easeInOut(duration: 0.25)) {
|
||||
showToolbar = true
|
||||
}
|
||||
resetHideTimer()
|
||||
} else {
|
||||
isLocked = true
|
||||
showToolbar = false
|
||||
}
|
||||
#else
|
||||
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秒自动隐藏
|
||||
VStack {
|
||||
Spacer()
|
||||
@ -489,19 +507,6 @@ struct PlayerContentView: View {
|
||||
.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 {
|
||||
#if os(macOS)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user