开发者

Presenting/dismissing modal view controller which contains a table makes the table go down

开发者 https://www.devze.com 2022-12-30 00:49 出处:网络
I present/dismiss modal view controller with tableview in it. Each presenting/dismissing causes the table to move down, leaving a gap between the table and top of the view. so each time i present afte

I present/dismiss modal view controller with tableview in it. Each presenting/dismissing causes the table to move down, leaving a gap between the table and top of the view. so each time i present after a dismiss, i see my table going down one row-height distance . keeping the routine, the table really 'leaves ' the screen. Please help.开发者_运维问答


I've run into this a few times and did the workaround (re-setting the frame) because of time pressure, but the last time I ran into it I found a real fix. Instead of creating your top level view controller in code (if it is), try having it be created in the UIWindow and IBOutlet it to the AppDelegate instead.

Worked for me.


If you use XIB, check autoresize option of your table view in the Interface Builder

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号