在 iOS 5.x 中增加 UITextView 中表情符号字符的字体大小

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

问题描述

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

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.

我知道这些表情符号字体比例,因为我在 OSX Lion 中将它们放大到巨大的比例,如果我创建一个带有表情符号字符作为标签的 UIButton 并将字体设置为Apple Color Emoji"和大小到 64 岁,它们在我的设备上看起来又大又漂亮.似乎只是 UITextView 没有调整它们的大小.

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.

推荐答案

您是否尝试过将 UITextView 的字体也设置为 AppleColorEmoji?在 iOS 上,AppleColorEmoji 似乎是唯一可以绘制放大表情符号的字体.如您所见,使用任何其他字体,表情符号永远不会超过大约 20x20 像素.

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.

我使用 这个方便的免费应用程序 Fonts! 进行了测试,它是快速获得有关实际设备本身的反馈的好方法.

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.

我注意到 Game Center 应用似乎能够将有趣的字体与放大的表情符号混合使用,因此很明显它可能比(相当普通的)表情符号字体做得更好!不过,我不知道这是它的代码有什么特殊之处,还是它使用的字体有什么特殊之处,看起来像是自定义字体.

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 中表情符号字符的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:从 UIWebView 中移除阴影 下一篇:iOS 如何使用私有 API?

相关文章