1

When I present a viewcontroller when voice memos is recording(The height of status bar is 40 px and red color). The presentedViewController's view frame is (0.0, 20.0, 320.0, 548.0).

I don't know the reason. But when I present a UINavigationControllerthe that rootviewcontroller is the viewcontroller, that works fine. Screenshot as below.

I print the description of each view:

(lldb) po self.pageViewController.view.description
"<_UIPageViewControllerContentView: 0x165ba360; frame = (0 20; 320 548); clipsToBounds = YES; opaque = NO; autoresize = W+H; layer = <CALayer: 0x165a57b0>>"


(lldb) po self.view.description
"<UIView: 0x166bc6b0; frame = (0 20; 320 548); autoresize = W+H; gestureRecognizers = <NSArray: 0x166bdb10>; layer = <CALayer: 0x166ac770>>"


(lldb) po self.view.superview?.description
▿ Optional<String>
  - some : "<UITransitionView: 0x166bdca0; frame = (0 20; 320 548); autoresize = W+H; layer = <CALayer: 0x166bdbd0>>"


(lldb) po self.view.superview?.superview?.description
▿ Optional<String>
  - some : "<UIWindow: 0x1668bb00; frame = (0 0; 320 568); autoresize = W+H; gestureRecognizers = <NSArray: 0x1668c2c0>; layer = <UIWindowLayer: 0x16689700>>"

The blue view is the presentingViewController's view.

I can solve the bug refer to Handling In-Call Status Bar with Custom Modal Presentation.

What's the reason of this bug? How can I solve the bug with any other better way?

Community
  • 1
  • 1
kai
  • 310
  • 3
  • 14
  • bro you need to look over http://stackoverflow.com/questions/12991935/how-to-programmatically-get-ios-status-bar-height – Mukesh Lokare Feb 05 '17 at 09:01
  • 1
    @Mukesh sorry, I don't want to know the height of status bar. I want to know the reason of presentedViewController's frame wrong. – kai Feb 05 '17 at 09:16

0 Answers0