在iOS 5.x的UITextView中增加表情字符的字体大小 [英] Increase the font size of emoji characters in a UITextView in iOS 5.x

查看:167
本文介绍了在iOS 5.x的UITextView中增加表情字符的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有UITextView并设置字体大小,比如32。当我运行应用程序(在模拟器和设备上),我看到一个大的光标和我输入的文本就像我假设它将。但是,如果我切换表情符号键盘,他们显示小。像字体的大小从来没有增加。



我知道这些表情符号字体的规模,因为我已经把它们放大到OSX的狮子巨大的比例,如果我创建一个带有表情符号的UIButton,因为它是标签,并将字体设置为Apple Color Emoji,尺寸为64,它们在我的设备上看起来非常华丽。看来只是UITextView没有调整它们的大小。

解决方案

您是否尝试将UITextView的字体设置为AppleColorEmoji?在iOS上,似乎AppleColorEmoji是唯一可以绘制放大的表情符号的字体。使用任何其他的字体,表情符号从来没有超过20x20像素,你已经注意到。



我使用这个方便的免费应用程序称为字体!,这是一个很好的方式获得实际设备本身的快速反馈。



我注意到Game Center应用程序似乎能够将一个有趣的字体与放大的表情符号混合在一起,所以显然它可能比(相当行人的)表情符号字体!我不知道这是否是代码中的特殊内容,或者它使用的字体是什么,它看起来像一个自定义的字体。


If I have UITextView and set the font size to, say 32. When I run the application (in both simulator and on the device), I see a large cursor and text that I type appears just as I'd assume it would. But if I switch the the Emoji keyboard, they display small. Like the size of the font was never increased.

I know these emoji font scales, as I've blown them up to giant proportions in OSX Lion, and if I create a UIButton with an emoji character as it's label and set the font to "Apple Color Emoji" and the size to 64, they look huge and gorgeous on my device. It seems just the UITextView isn't resizing them.

解决方案

Have you tried setting the UITextView's font to AppleColorEmoji as well? On iOS, it seems that AppleColorEmoji is the only font that will draw scaled-up emoji. Use any other font, and the emoji never get larger than about 20x20 pixels, as you've noticed.

I did my tests using this handy free app called Fonts!, which is a nice way of getting quick feedback on the actual device itself.

I note that the Game Center app seems to be able to mix an interesting font with scaled-up emoji, so clearly it IS possible to do better than the (rather pedestrian) emoji font! I don't know whether this is something special in its code, though, or something special about the font it uses, which looks like a custom one.

这篇关于在iOS 5.x的UITextView中增加表情字符的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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