开发者

"nested push animation can result in corrupted navigation bar" when call launcherView: didSelectItem:

In the three20 TTCategory example, I am trying to modify the LauncherViewTestController to launch an test view controller. I created a TestContrller class and register as

[map            from: @"tt://test"
              parent: @"tt://launcherTest"
    toViewController: [TestController class]
            selector: nil
          transition: 0];

Then in launchView:didSelectItem:, I try to navigate to this test view controller

 - (void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item {
        TTNavigator *navigator = [TTNavigator navigator];
        [navigator openURLAction:[ [TTURLAction actionWithURL开发者_StackOverflowPath:@"tt://test"] applyAnimated:NO]];
 }

However, I keep getting "error nested push animation can result in corrupted navigation bar", and the navigation bar is not working properly with title stack on each other. I am very new to iphone development, can anybody give me some help here?

Edit, I posted my answer below, I need map to SharedViewController instead ViewController.


Here's a working example of TTLauncher i'm using and it's pushing controllers based on TTLauncherItem's action URL. registering the controllers in the app delegate is trivial, so i only including the functions for the launcher controller.

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)loadView {
  [super loadView];

  _launcherView = [[TTLauncherView alloc] initWithFrame:self.view.bounds];
  _launcherView.backgroundColor = [UIColor whiteColor];
  _launcherView.delegate = self;
  _launcherView.columnCount = 3;

  _launcherView.pages = [NSArray arrayWithObjects:
                         [NSArray arrayWithObjects:
                          [[[TTLauncherItem alloc] initWithTitle:@"Breaking News"
                                                           image:@"bundle://Icon.png"
                                                             URL:@"portal://news/breakingnews" 
                                                       canDelete:NO] autorelease],
                          nil],

                         nil
                         ];
  [self.view addSubview:_launcherView];
}



///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark -
#pragma mark TTLauncherViewDelegate


///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)launcherView:(TTLauncherView*)launcher didSelectItem:(TTLauncherItem*)item {
  TTOpenURL(item.URL);
}


i find the problem is that I need map to a sharedviewcontroller instead of viewcontroller.

[map            from: @"tt://test"
              parent: @"tt://launcherTest"
    toSharedViewController: [TestController class]
            selector: nil
          transition: 0];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜