【问题标题】:Animation not working on iPad. same works on iphone动画在 iPad 上不起作用。同样适用于 iPhone
【发布时间】:2010-12-28 12:35:16
【问题描述】:

我有一个非常简单的项目,它尝试使用基于块的 iOS4.0 动画为 UIView 设置动画。

标题

@interface animatepadViewController : UIViewController {

    UIView *contentView;
}

@property(nonatomic, retain) IBOutlet UIView *contentView;



@end

实现

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];

    [UIView animateWithDuration:1.0 animations:^{self.contentView.alpha = 0.0;}];

}

我在界面生成器中添加了一个 UIVIew 类型的子视图,背景颜色为黑色。

这些是我对基于默认 ipad“视图”的项目所做的唯一更改。

我收到以下错误

2010-12-28 17:59:05.689 animatepad[29835:207] *** +[UIView animateWithDuration:animations:]: unrecognized selector sent to class 0x217689c

这只会发生在 ipad 上,不会发生在 iPhone 上

提前致谢

【问题讨论】:

    标签: iphone ipad ios animation


    【解决方案1】:

    您是否已更新您的 iPad 以使用 iOS 4.2?在 iPad 的 iOS (3.2.) 发行版中不提供 Blocks。

    【讨论】:

    • 啊……大概就是这样。我如何为模拟器做到这一点?
    【解决方案2】:

    要更新模拟器,您需要将 Xcode 更新到 3.2.5 版。

    【讨论】:

      猜你喜欢
      • 2022-11-11
      • 1970-01-01
      • 1970-01-01
      • 2021-12-25
      • 1970-01-01
      • 2011-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多