UrbanApps / UAModalPanel

An animated modal panel alternative for iOS

Home Page:http://code.coneybeare.net/uamodalpanel-an-open-source-modal-panel-alter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

contentView is always (0,0,0,0) when constructing panel

adamgit opened this issue · comments

Customizing the panel fails in most cases because you cannot read the size of the content area.

Workaround:

  1. after instantiating the panel (initWithFrame:), add it to the target view
  2. call [panel layoutSubviews]; to force it to calculate its TRUE sizes
  3. run the customization code

NB: this means you must not put your panel-contents-code into "initWithFrame:" - because during that method you have no way to get your sizes correct ... unless it's safe to call layoutSubviews inside the constructor?

(your example panel ignores sizes, so doesn't have this problem)