在iPhone中缩放后保留标签的分辨率 [英] Retain the resolution of the label after scaling in iphone

查看:54
本文介绍了在iPhone中缩放后保留标签的分辨率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在视图中有一个标签.缩放视图后,标签看起来有点模糊,分辨率丢失.缩放后如何保留分辨率.

I am having a label in a view.After scaling the view, the label looks little blurred,the resolution is lost.How to retain the resolution after scaling.

这是我的扩展代码

secondView.transform = CGAffineTransformIdentity;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
secondView.transform = CGAffineTransformMakeScale(2 ,2);
[UIView commitAnimations];
[self.view bringSubviewToFront:secondView];

推荐答案

我设置标签的ContentScaleFactor属性以在缩放后保留标签的分辨率.

I set the ContentScaleFactor property of the label to retain the resolution of the label after scaling .

[label setContentScaleFactor:2];

这篇关于在iPhone中缩放后保留标签的分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆