PKAddPaymentPassViewController显示缩放异常问题求助
Hey there! Great call suspecting the iPhone 6+ incompatibility as the root cause—that’s exactly what’s going on here. Let me break down why this happens and how to fix it:
Why the Zoomed UI Happens
System view controllers like PKAddPaymentPassViewController rely on your app’s screen scaling and layout compatibility settings. If your app hasn’t been updated to support iPhone 6 and later models (i.e., you’re still using old launch images instead of a launch screen storyboard), iOS will run your app in a scaled "compatibility mode" for larger screens. This forces all system components (including this payment pass VC) to stretch/zoom incorrectly.
Step-by-Step Fixes
1. Replace Old Launch Images with a Launch Screen Storyboard
This is the most critical fix:
- In Xcode, go to your project’s General tab.
- Under the App Icons and Launch Images section, set the Launch Screen File to a new or existing
LaunchScreen.storyboard(create one if you don’t have it—right-click your project > New File > Launch Screen). - Remove any old entries under Launch Images Source to eliminate conflicts.
2. Clean Up Info.plist Configuration
- Open your
Info.plistfile and delete any legacyUILaunchImageskey-value pairs. These old launch image settings tell iOS to use compatibility mode, which we want to avoid.
3. Verify Auto Layout and Size Class Support
- Ensure the view controller that presents
PKAddPaymentPassViewControlleruses Auto Layout instead of fixed frames. While this isn’t the direct cause, inconsistent layout in your presenting VC can sometimes compound display issues with system modals.
4. Test the Fix
After making these changes, rebuild and run your app. When you present the PKAddPaymentPassViewController again, it should render at the correct scale without zooming.
Quick Check
Since the feature works perfectly in your demo app, compare the launch screen and layout settings between your demo and main app—you’ll likely see the demo uses a launch screen storyboard while your main app doesn’t.
内容的提问来源于stack exchange,提问作者S P Balu Kommuri

