ImageAnimatorViewController

ImageAnimatorViewController

我想让this example project对所有视图都使用笔尖,而不是通过编程方式创建视图。

有人可以引导我完成执行此操作所需的步骤吗?

最佳答案

该项目已经在主视图中使用了xib。如果要对ImageAnimatorViewController使用xib,则应替换为:

+ (ImageAnimatorViewController*) imageAnimatorViewController
{
  return [[[ImageAnimatorViewController alloc] init] autorelease];
}


有了这个:

+ (ImageAnimatorViewController*) imageAnimatorViewController
{
  return [[[ImageAnimatorViewController alloc] initWithNibName:@"MyNibName" bundle:nil] autorelease];
}


然后创建xib(新文件->用户界面->视图)。将视图的文件所有者设置为ImageAnimatorViewController,并将视图出口连接到文件的所有者->视图。

除此之外,您可能想删除任何程序化布局代码,并替换为在ImageAnimatorViewController.h中指定为IBOutlet的UI对象。

09-27 00:12