开发者

iPhone - Toolbar in UIViewController disappear right after showing up

开发者 https://www.devze.com 2023-03-13 08:42 出处:网络
I use this code to display a one item Toolbar in UIViewController (which is pushed by UINavigationController). The toolbar shows up and immediately disappear:

I use this code to display a one item Toolbar in UIViewController (which is pushed by UINavigationController). The toolbar shows up and immediately disappear:

UIBarButtonItem * logoutButton = [[UIBarButtonItem alloc] initWithTitle:@"Log out" style:UIBarButtonItemStylePlain target:self action:nil];
NSMutableArray * arr = [NSMutableArray arrayWithObjects:logoutButton, nil];
[self setToolba开发者_JAVA百科rItems:arr animated:NO];
[self.navigationController setToolbarHidden:NO animated:NO];

Do you know what the problem is?


where is this code? Doesn't seem to be anything out of the ordinary here so either has to do with where you are calling it, or something else that happens afterwards (like setting toolbarHidden to YES later or something)

0

精彩评论

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

关注公众号