Persistent UIBarButtonItem in UIToolbar?

后端 未结 3 1011
萌比男神i
萌比男神i 2020-12-15 14:40

I\'ve been developing an iPhone app that uses a UIToolbar (in the context of a UINavigationController) to display a small status icon at the bottom of the screen. The toolba

3条回答
  •  臣服心动
    2020-12-15 15:28

    I found this works for me:

    CGFloat height = [self.toolbar frame].size.height;
    CGRect rootBounds = self.window.rootViewController.view.bounds;
    CGRect frame = CGRectMake(0, CGRectGetHeight(rootBounds) - height, CGRectGetWidth(rootBounds), height);   
    [self.toolbar setFrame:frame];
    [self.navigationController.view addSubview:self.toolbar];
    

提交回复
热议问题