小编Pat*_*ick的帖子

Apple Emoji /通过NSString迭代

我想遍历表情符号输入字符串的'字符'(来自UITextField),然后一个接一个地显示那些带有UILabel的表情符号图标.

for (int i=0; i < len; i++) {  
    unichar c = [transformedString characterAtIndex:i];  
    [label setText:[NSString stringWithFormat:@"%C", c]];  
...
Run Code Online (Sandbox Code Playgroud)

这适用于ASCII文本但不适用于表情符号字体(除心脏符号外均为空).正如我所注意到的,单个表情符号图标由字符串中的2个字符表示.据我所知,表情符号使用私有区域unicode字符.

反正有没有实现这个目标?

非常感谢,你让我有些头疼......

xcode fonts objective-c emoji

4
推荐指数
1
解决办法
3355
查看次数

UIView animateWithDuration立即返回

我正在尝试为嵌入在UIView中的标签制作动画.

这是代码:

-(void)displayText:(NSString*)text {


[label setText:text];


[UIView animateWithDuration:5.0
                      delay:0.0
                    options:UIViewAnimationOptionCurveEaseIn
                 animations:^{
                     [labelView setAlpha:1.0];
                 }
                 completion:nil
 ];

[UIView animateWithDuration:5.8
                      delay:0.0
                    options:UIViewAnimationOptionCurveEaseIn
                 animations:^{
                     [labelView setAlpha:0.0];
                 }
                 completion:nil
 ];
}
Run Code Online (Sandbox Code Playgroud)

为了验证,调用该方法,我设置了一个断点.

呼叫立即返回,但仅显示动画结束.

我将UIView连接到控制器.

请帮忙,我被困住了.

提前致谢 !帕特里克

iphone animation objective-c

2
推荐指数
1
解决办法
5369
查看次数

标签 统计

objective-c ×2

animation ×1

emoji ×1

fonts ×1

iphone ×1

xcode ×1