简体   繁体   中英

Changing font size of attributed text in UITextView takes a lot of time in iOS 6 using Xcode 5

I am developing an application that target iOS6+.

I have a text view with with large attributed text. Maybe 1000 lines odd lines red color and other lines green color.

I use below code for changing the font size of the textview:

self.doaTextView.editable= YES;
self.doaTextView.font = [UIFont systemFontOfSize:self.FontSilder.value];
self.doaTextView.editable= NO;

but it takes much time. It is about 2 second on iOS 7 and about 5-10 second on iOS 6!!!

(I enable and disable editable feature, becasue if I do not do this the changes not appear in iOS 6. Please see here )

What is the problem?

Edit

I found this topic related to this problem too. Really there is not any solution for this?

我终于通过重新创建attributedtext文本并将其设置为uitextview的新attributedtext uitextview来解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM