我正在使用JTRevealSidebar并使用静态单元构建一个表视图控制器,以用作我的滑出导航。当我将导航控制器作为开始视图时,我会看到他们应该是的所有表格单元格。当我将该视图用作导航的滑出视图时,它是一个空表视图。这是我用来将其设置为侧边栏并显示它的代码。
//This is in the header file
@property (nonatomic, strong) ehrxSideBarController *leftSidebarViewController;
//Then in the implementation file
@synthesize leftSidebarViewController = _leftSidebarViewController;
- (UIView *)viewForLeftSidebar {
CGRect viewFrame = self.navigationController.applicationViewFrame;
UITableViewController *controller = self.leftSidebarViewController;
if ( ! controller) {
self.leftSidebarViewController = [[ehrxSideBarController alloc] init];
self.leftSidebarViewController.sidebarDelegate = self;
controller = self.leftSidebarViewController;
controller.title = @"LeftSidebarViewController";
}
controller.view.frame = CGRectMake(0, viewFrame.origin.y, 270, viewFrame.size.height);
controller.view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
return controller.view;
}
我确保在我的故事板中视图具有与之关联的正确控制器类。
答案 0 :(得分:0)
嗯,从没有任何回应来判断,即使有赏金,我猜这是模糊或没有人尝试过。我最终在代码中动态创建了部分和单元格,而不是使用静态单元格。