• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setFrame doesn't work if I put the view into UINavigationController?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setFrame doesn't work if I put the view into UINavigationController?


  • Subject: Re: setFrame doesn't work if I put the view into UINavigationController?
  • From: GongHao [龚浩] <email@hidden>
  • Date: Sun, 29 Mar 2015 15:26:47 +0800
  • Acceptlanguage: zh-CN
  • Thread-topic: setFrame doesn't work if I put the view into UINavigationController?

Thanks,

Eventually I got it work by doing it in navigationController:didShowViewController:animated:
UINavigationController will set the content view controller's view size in a private method _startTransition:fromViewController:toViewController: , changing the frame after this call should work.

This is quite hacky though.

在 2015/3/29 15:13, Kyle Sluder 写道:

On Sun, Mar 29, 2015, at 12:24 AM, GongHao [龚浩] wrote:



I want to change the frame size of my UIViewController in viewDidAppear:



The frame of a view controller's view is dictated by the _parent_ of the
view controller that owns the view.



, usually it works but if I add the UIViewController into a
UINavigationController, setFrame doesn't work any more. Anyone knows how
I can get it work well?



As per the above, the navigation controller owns this frame. It is not
yours to change.

--Kyle Sluder

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: setFrame doesn't work if I put the view into UINavigationController?
      • From: Kyle Sluder <email@hidden>
References: 
 >setFrame doesn't work if I put the view into UINavigationController? (From: GongHao [龚浩] <email@hidden>)
 >Re: setFrame doesn't work if I put the view into UINavigationController? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: setFrame doesn't work if I put the view into UINavigationController?
  • Next by Date: Re: setFrame doesn't work if I put the view into UINavigationController?
  • Previous by thread: Re: setFrame doesn't work if I put the view into UINavigationController?
  • Next by thread: Re: setFrame doesn't work if I put the view into UINavigationController?
  • Index(es):
    • Date
    • Thread