I’m trying to remove the background view for my UITargetPreview
. I made the background color clear, however, you can still see the frame of the background.
This is what it currently looks like:
I currently have a view that has the text container and the image inside of it and that’s what I use as the view for the UITargetedPreview
.
Is there a way to only show the image and the text and not the background frame?
4
Answers
Have you tried subclassing the UIView as a UIControl?
I had a similar issue but in my case the view for UITargetedPreview was glitchy. However, changing the UIView to a UIControl fixed everything.
try removing shadow of that background view.
There is a tricky method to hide the shadow and to do that you should find a view with
_UIPlatterSoftShadowView
class name in the view hierarchy and then hide it.NOTE: It’s not documented internal class and can be changed anytime further but it works now on both ios 13/14.
You need to study UIBezierPath() to outline the specific area you want to enclose before you present the target view.
After that, you shall assign the specific path to shadow path / visible path