UITextField flickers and gets wavy when size is scaled down

58 views Asked by At

I've got a UITextField with "llllllllll" as text in it.

I use a pinch gesture to scale it down by decreasing view's transform.a from 1 down to 0.001 or lower. When the text field gets smaller I observe wave and hairline flicker effects.

What methods are available in iOS to avoid those effects?

Essentially, any behavior which is easy on eyes is fine, as long as it looks like that the text is decreasing in size.

Adding the youtube video and animated gif that shows the effects: wave and flicker effect (youtube) wave and flicker effect (animated gif)

I haven't tried anything yet. Is there any standard approach to this common problem?

1

There are 1 answers

0
AKV On

I'm trying to add blur effect to see if the flicker and wave effects don't look too bad. But blur effect is not affecting the UITextField. It does work ok with UILabel though.

This is the code:

blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; 
visualEffectView = [[UIVisualEffectView alloc] initWithEffect:boardView.blurEffect];

visualEffectView.frame = textField.bounds;
textField.backgroundColor = [UIColor clearColor];
[textField addSubview:visualEffectView];

blur effect on uitextfield