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()
|
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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user