我的UITextView
添加了UIView
。它只是显示一个字符串。
当我将UIPinchGestureRecognizer
添加到UIView
时:
UIPinchGestureRecognizer * pinchGR = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)];
pinchGR.delegate = self;
[self addGestureRecognizer:pinchGR];
然后我处理UIView的动作并在UITextView中缩放字体大小
- (void)handlePinch:(UIPinchGestureRecognizer *)recognizer {
recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
CGFloat currentSize = _textView.font.pointSize;
CGFloat toSize = currentSize * recognizer.scale ;
[_textView setFont:[UIFont systemFontOfSize:toSize]];
recognizer.scale = 1;
}
这是我的结果,我的UITextView
显示非常糟糕(不透明)
我怎么能像Snapchat一样呢?
请给我一些想法。
答案 0 :(得分:0)
/consumers/
试试这个!!! ...