Adding a UINavigationController as a subview of UIView

前端 未结 5 628
南方客
南方客 2020-12-06 01:39

I\'m trying to display a UILabel on top of a UINavigationController. The problem is that when I add the UILabel as a subview of UIWindow it will not automatically rotate sin

5条回答
  •  醉梦人生
    2020-12-06 02:36

    Why don't you use App Frame instead of adding some values to origins? I mean using:

    CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
    

    as a reference frame, and do something like this:

    nav.view.frame = CGRectMake(appFrame.origin.x, appFrame.origin.y, ...
    

    This one worked for me.

提交回复
热议问题