UITableView横向滚动问题 [英] UITableView landscape scrolling issue

查看:85
本文介绍了UITableView横向滚动问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些背景知识

A little background:

我的应用被设计为UITableView中的Web表单。它的格式类似于iPhone的设置>邮件,联系人,日历>帐户名>帐户信息。一些区别:1)我在底部有一个大文本框,您可以在其中放置一个消息正文。 2)我在文本框下方有一个红色的大按钮,类似于设置>邮件,联系人,日历>帐户名中的红色删除帐户按钮。红色按钮按钮将提交表单。

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".

上述视图适合于320宽乘416高度的视图(换句话说,无需滚动查看纵向模式,包括导航栏)

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)

问题:

当我旋转时为了景观,UITableView无法滚动以查看整个416高度。我停留在268 x 480(加上导航栏)的位置,表格的底部(文本框和红色按钮的一部分)被切除并隐藏在下方。如果您使用滚动回弹功能,则可以暂时看到其余视图,直到放开为止。

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.

其他设计细节


  • 我使用UIViewController并将UITableView添加到视图中

  • 我正在使用:

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

self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

我尝试强制视图和表在(viewDidLoad)旋转之前和之后(通过通知)旋转高度为416。仍然无法滚动UITableView

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?

推荐答案

您是否尝试过此方法(您还希望删除有关强制视图高度和表):

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;

这篇关于UITableView横向滚动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆