UIActivityViewController whatsapp share dialog white text background

474 Views Asked by At

I am using below code to share some content. When I choose whatsapp option, I am seeing white background behind the texts. I am totally lost because UIActivityController handles presenting the share dialog. Any idea how to remove the white background?

let vc = UIActivityViewController(activityItems: [text, url], applicationActivities: [])
self.present(vc, animated: true)

enter image description here

1

There are 1 best solutions below

4
zazzy78 On BEST ANSWER

For some reason, it looks like the WhatsApp interface is applying a white background colour to UILabels. You could give this a try:

let vc = UIActivityViewController(activityItems: [text, url], applicationActivities: [])
UILabel.appearance(whenContainedInInstancesOf: [UIView.self]).backgroundColor = .clear
self.present(vc, animated: true)