I’m using React Native and the package react-native-prevent-screenshot-ios-android to block screenshots in my app.
It works fine in LTR languages (English, etc.), but when the device language is Arabic (RTL), a very strange UI bug happens:
❗ Problem
Whenever I call:
enableSecureView();
on screen focus, and:
disableSecureView();
on blur, the entire iOS app layout shrinks from the bottom. Each time I navigate into/out of the screen, the UI becomes smaller and smaller.
This does NOT happen in LTR mode — only when RTL layout is active.
Example behavior:
- Enter screen → enableSecureView() → layout slightly shrinks
- Leave screen → disableSecureView()
- Enter again → shrinks more
- Repeat → UI becomes unusable
❗ Additional Issue
If I try to patch the iOS native file to fix the shrinking:
- The layout bug is fixed.
- BUT screenshot blocking no longer works on iOS (because the library uses a specific
secureTextEntry+ layer re-parenting hack).
Currently, I cannot achieve both:
- RTL layout working
- iOS screenshot blocking
-
It might be better to report an Issue at github.com/Praveencena88/… rather than to ask here.Amadan– Amadan2025年11月16日 21:15:31 +00:00Commented Nov 16, 2025 at 21:15
-
Thanks. I'll report it there, though the repo seems unmaintained. It's worth noting that I've tested several alternative libraries, and they all share this exact same cumulative shrinking bug in RTL. It seems to be a fundamental issue with the native secureTextEntry hack on iOS rather than just this specific library.Ahmet Hoşca– Ahmet Hoşca2025年11月20日 14:28:27 +00:00Commented Nov 20, 2025 at 14:28