hackiftekhar / IQKeyboardManager

Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more.
MIT License
16.47k stars 2.41k forks source link

Accessibility Bold Font has wrong Down arrow #1412

Closed falcon283 closed 6 years ago

falcon283 commented 6 years ago

Man ... this is the weirdest bug I ever seen on iOS and it's not your fault. Basically the Down arrow on the inputAccessoryView is rendered wrong by iOS if Bold Font is configured in accessibility

Steps to reproduce the behavior

  1. Go to settings, accessibility and enable Bold Font
  2. Open the Demo App (Swift or Objc doesn't matter)
  3. See the next (Down arrow)

Expected behavior The Down arrow should be rendered properly.

Screenshots simulator screen shot - iphone 5s - 2018-08-22 at 11 07 42

Demo Project Use your Demo Project. It's perfectly fine

Versions

Xcode: 9.4 Mac OS: 10.13.6 Simulator/Device: 5s 11.4, 7 Plus 11.4 Library Version: 6.0.3 / 6.1.1

Additional info I inspected the bug because I was curious to find the reason of the overlapping. Actually, in my opinion, this is an iOS bug and your code is fine. When accessibility Bold Font is enabled all the "template" rendering mode images are drown in a special way to increase the contrast. Anyway in this particular case seems the OS use some sort of caching to create the final images. It looks like the OS doesn't figure out that the Down arrow cache is actually different from the Up Arrow cache and it mix both of them. I replaced Down Image using Left or Right images just for testing purpose and it works like a charm ... so OS simply mix something behind the scene if the files are close enough by some crazy algorithm.

Solution Ideas:

  1. Disable the template rendering mode forcing the images to render using always original rendering mode. This will drop the "bold" image effect.
  2. slightly change the size of the canvas for Down arrow. I saw that just enlarging it by 1pt it solve the issue.

This is all what I can tell you. This is insane to me 🤣

falcon283 commented 6 years ago

I followed up with some other researches and looks like a simulator bug. I was just able to run the app on a real device (both iOS 10 and 11) and there is no issue.

It's up to you if you would like to work the issue. At least you know about it ;)

hackiftekhar commented 6 years ago

If there is an issue then please send a pull request with a fix.

falcon283 commented 6 years ago

Being just an iOS Simulator issue we can close it