私はUIPageController
を使用して、異なるコントローラ間を移動しています。今度はその下にドットを追加したいので、ユーザーはどのコントローラーにいるかを見ることができます。これはUIPageControl
によって達成されます。これらの2つを組み合わせる簡単な方法はありますか? UIPageViewController.hの底(iOS6 +)からUIPageControllerとUIPageControlを組み合わせていますか?
16
A
答えて
27
〜
両方の方法が実装されている場合、ページインジケータが表示されるようになり、遷移スタイル「はUIPageViewControllerTransitionStyleScroll」は、ナビゲーション配向「UIPageViewControllerNavigationOrientationHorizontal」です。 両方のメソッドが 'setViewControllers:...'呼び出しに応答して呼び出されますが、プレゼンテーションインデックスはジェスチャー駆動のナビゲーションの場合に自動的に更新されます。
- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(6_0); // The number of items reflected in the page indicator.
- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(6_0); // The selected item reflected in the page indicator.
そうでなければ、私はあなたのUIPageViewController
にUIPageControl
を追加して、基本的には同期でそれらを保つためにそれらを一緒に結び付けるために必要だと思う...しかし、あなたはすべて手動で同点を行う必要があります。
10
Xcodeのページベースアプリケーションテンプレートを使用している場合は、 属性インスペクタに移動し、TransitonスタイルプロパティをScrollに設定します。
とアプリケーションAppDelegate.mファイルに移動し、Xcodeのベースページに対して
UIPageControl *pageControl = [UIPageControl appearance];
pageControl.pageIndicatorTintColor = [UIColor lightGrayColor];
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
pageControl.backgroundColor = [UIColor whiteColor];
ため色合いの色を設定だけで、その色が白に設定されているそのすでにiOSの6、iOSの7用のテンプレート。
関連する問題
- 1. ブートストラップとバーボンを組み合わせて
- 2. Python itertoolsの組み合わせの組み合わせ
- 3. データウェアハウス:冗長な組み合わせの組み合わせ
- 4. serviceAutoStartProvidersをApp_Offline.htmと組み合わせて実行しますか?
- 5. 配列と組み合わせパターンの組み合わせを見つける
- 6. iPhoneはプッシュ通知を組み合わせていますか?
- 7. 列の組み合わせの組み合わせデータフレームの行ではない
- 8. geom_pointとgeom_lineをggplot2のggplot2と組み合わせて2つのグループ化要因を組み合わせる
- 9. AngularJSと組み合わせてjQueryを使用していますか?
- 10. メテオとエクスプレスを組み合わせる
- 11. wgetとPHPを組み合わせた
- 12. ec2とlinodeを組み合わせる
- 13. mod_accessとmod_authを組み合わせる
- 14. ドラッグアンドドロップとスケーリングを組み合わせる
- 15. * -servlet.xmlとapplicationContext.xmlを組み合わせる
- 16. MatplotlibとPyQt4を組み合わせる
- 17. イベントとプロミスを組み合わせる
- 18. DIとコンストラクタパラメータを組み合わせる?
- 19. itertoolsとマルチプロセッシングを組み合わせる?
- 20. ANDとORを組み合わせる
- 21. JavaScriptとlessを組み合わせる
- 22. VLOOKUPとフィルターを組み合わせる
- 23. intをvoidと組み合わせる*
- 24. @Providesと@Injectを組み合わせる
- 25. Reactとネイティブアプリを組み合わせる
- 26. AQGridViewとHJCacheを組み合わせる
- 27. ctypesとswigを組み合わせる
- 28. link_toとrender:partialを組み合わせる
- 29. asmxとCodeBehindを組み合わせる
- 30. javascriptとjqueryを組み合わせる
現在のページを手動で設定する方法 –
http://stackoverflow.com/questions/8400870/uipageviewcontroller-return-the-current-visible-viewはおそらくあなたが探しているものですか? –