【问题标题】:Problem switching between portrait mode and landscape mode for a table表格在纵向模式和横向模式之间切换的问题
【发布时间】:2010-06-29 20:03:38
【问题描述】:

我有一个 UIViewController 继承了 UITable 的所有委托。 我有一个名为 table 的 UITableView,它在我的 simple_tableViewController.h 中设置。

我已经设置了

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES; }

但主视图会旋转,但表格不会。

我已经搜索了几个多小时,以了解如何在 UIViewController 中为我的 UITableView 实现从纵向到横向的旋转。

这是一些代码

@interface simple_tableViewController : UIViewController { UITableView *table; UISearchBar *search; NSDictionary *allNames; NSMutableDictionary *allNamesSearch; NSMutableDictionary *names; NSMutableArray *keys; BOOL isSearching; } @property (nonatomic, retain) IBOutlet UITableView *table; @property (nonatomic, retain) IBOutlet UISearchBar *search; @property (nonatomic, retain) NSDictionary *allNames; @property (nonatomic, retain) NSMutableDictionary *allNamesSearch; @property (nonatomic, retain) NSMutableDictionary *names; @property (nonatomic, retain) NSMutableArray *keys; @property (nonatomic, retain) NSMutableArray *keysSearch; - (void)resetSearch; - (void)handleSearchForTerm:(NSString *)searchTerm; @end

您可以看到我创建 UITableView 的位置。

谢谢

【问题讨论】:

    标签: uitableview rotation landscape


    【解决方案1】:

    好的,这是因为我将视图添加到主窗口视图。所以主窗口视图正在旋转,但导航控制器视图没有。

    希望对某人有所帮助。

    谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-09
      • 1970-01-01
      • 2011-10-14
      • 2013-12-02
      • 2012-03-05
      相关资源
      最近更新 更多