UITableView landscape scrolling issue

折月煮酒 提交于 2019-12-11 19:06:44

问题


A little background:

My app is designed as a web form in a UITableView. It is similar in format to the iPhone's Settings > Mail,Contacts,Calendars > "Account Name" > Account Info. A few differences: 1) I have a big text box on the bottom where you can put a "message body". 2) I have a big red button underneath the text box, similar to the red "Delete Account" button at Settings > Mail,Contacts,Calendars > "Account Name". the red button button submits the "form".

The view described above fits in a 320 width by 416 height view (in other words, there is no need to scroll in portrait mode including a Nav Bar)

The issue:

When I rotate to landscape, the UITableView cannot scroll to view the entire 416 height. Im stuck at 268 by 480 ( plus nav bar) and the bottom part of the table (part of the text box and the red button) are cut off and hidden below. If you use the scroll "spring-back" you can temporarily see the rest of the view, until you let go.

Other design details

  • Im using UIViewController and adding the UITableView to the view
  • I'm using:

    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

  • I tried forcing both the view and table to have height of 416 before (viewDidLoad) and after (via notification) rotation. Still can't scroll the UITableView

Does anyone have any suggestions as to what the issue might be or what else to try?


回答1:


Have you tried this (you'll also want to remove the bit about forcing the height of the view and the table):

self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;


来源:https://stackoverflow.com/questions/3025422/uitableview-landscape-scrolling-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!