diff --git a/Sources/MiniPlayerApp.swift b/Sources/MiniPlayerApp.swift index f114d1e..1b81167 100644 --- a/Sources/MiniPlayerApp.swift +++ b/Sources/MiniPlayerApp.swift @@ -398,6 +398,9 @@ struct PlayerContentView: View { #endif } .frame(maxWidth: .infinity, maxHeight: .infinity) + #if os(iOS) + .allowsHitTesting(!isLocked) + #endif .onTapGesture(count: 2) { #if os(iOS) recordInteraction() @@ -471,19 +474,6 @@ struct PlayerContentView: View { } ) - // iOS 锁屏遮罩层(拦截触摸,置于图标下方) - #if os(iOS) - if isLocked { - Color.black.opacity(0.01) - .ignoresSafeArea() - .allowsHitTesting(true) - .contentShape(Rectangle()) - .onTapGesture { - // 吞掉所有触摸 - } - } - #endif - // 底部控制栏 — 半透明,30秒自动隐藏 VStack { Spacer() @@ -505,6 +495,9 @@ struct PlayerContentView: View { if hovering { resetHideTimer() } } .transition(.move(edge: .bottom).combined(with: .opacity)) + #if os(iOS) + .allowsHitTesting(!isLocked) + #endif } } }