ページベースのアプリがあります。各ページの上部に 3 つの uibutton、右側にアルファベット付きの uiscrollview (uitable でデータを並べ替えるための uibutton)、中央に uitableview があります。セルの詳細ビューを表示するには? uinavigationcontroller を追加する必要がある場合、これはできません。追加すると、テーブル、ボタン、スクロールビューとのやり取りが無効になります。そして別の質問は、次のページに移動したときにテーブルビューとスクロールビューに新しいデータを表示する方法です??
rootViewController クラスと DataViewController クラスがあります。rootViewController リスト:
@interface RootViewController ()
@property (readonly, strong, nonatomic) ModelController *modelController;
@end
@implementation RootViewController
@synthesize pageViewController = _pageViewController;
@synthesize modelController = _modelController;
@synthesize navContr = _navContr;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Configure the page view controller and add it as a child view controller.
//[self presentModalViewController:navContr animated:YES];
self.pageViewController = [[[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil] autorelease];
self.pageViewController.delegate = self;
DataViewController *startingViewController = [self.modelController viewControllerAtIndex:0 storyboard:self.storyboard];
NSArray *viewControllers = [NSArray arrayWithObject:startingViewController];
[self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:NULL];
self.pageViewController.dataSource = self.modelController;
[self addChildViewController:self.pageViewController];
[self.view addSubview:self.pageViewController.view];
self.navContr = [[UINavigationController alloc] initWithRootViewController:self.pageViewController];
[self.view addSubview:self.navContr.view];
// Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages.
CGRect pageViewRect = self.view.bounds;
self.pageViewController.view.frame = pageViewRect;
[self.pageViewController didMoveToParentViewController:self];
// Add the page view controller's gesture recognizers to the book view controller's view so that the gestures are started more easily.
self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;
for (UIGestureRecognizer *recognizer in self.pageViewController.gestureRecognizers){
if ([recognizer isKindOfClass:[UITapGestureRecognizer class]]){
[recognizer setEnabled:NO];
}
}
}
いくつかの操作の後、動作しますが、うまく動作させるには助けが必要です!
だから今はこんな感じ
次の質問: 上部の茶色のスペースを削除するにはどうすればよいですか?
::アップデート::
問題が解決しました。UINavigationController の y 軸位置を -20 に設定するだけです;)