【问题标题】:How do I use Storyboard in creating an iOS Titanium module?如何使用 Storyboard 创建 iOS Titanium 模块?
【发布时间】:2013-02-16 21:34:59
【问题描述】:

有人有例子吗?我已经为 Titanium 创建了 iOS 和 Android 模块,但还没有找到人们使用 Storyboard 进行视觉效果的任何示例。

【问题讨论】:

    标签: ios module storyboard titanium


    【解决方案1】:

    我知道您可以使用 initWithNibNamecheck this SO answer out. 在模块中加载 nib

    特别是对于故事板,我认为这会变得复杂,因为故事板定义了一个完整的导航结构。我认为您有两个选择,将情节提要中的特定窗口分解为 nib 文件,然后根据需要加载它们,或者使用类似以下的代码打开情节提要本身:

    // You have to get the resource bundle first 
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"YourStoryBoards" bundle:resourceBundle];
    UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"yourViewController"];
    vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentViewController:vc animated:YES completion:NULL]; 
    

    我还没有尝试过,但我认为关键是提供正确的资源包,然后从模式打开。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-05
      • 2013-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 2012-05-15
      相关资源
      最近更新 更多