iOS 視圖控制器:ROSwipenger

jopen 9年前發布 | 11K 次閱讀 iOS開發 移動開發 ROSwipenger

ROSwipenger 是一個可以在多個視圖控制器之間進行轉換的自定義庫。

alt text

Usage

To run the example project, clone the repo, and runpod installfrom the Example directory first.

ROSwipenger is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ROSwipenger"

  1. Create theROSwipengerview controller:

    ImageViewController *dummy1 = [ImageViewController new];
    dummy1.image = [UIImage imageNamed:@"Brian.jpg"];

    ImageViewController *dummy2 = [ImageViewController new]; dummy2.image = [UIImage imageNamed:@"Rob.jpg"];

    ImageViewController *dummy3 = [ImageViewController new]; dummy3.image = [UIImage imageNamed:@"Heather.jpg"];

    ROSwipenger *controller = [[ROSwipenger alloc] initWithTitles:@[@"Brian", @"Rob", @"Heather"] andViewControllers:@[dummy1, dummy2, dummy3]];</pre>
    </li>

  2. Present the view controller:

    [self presentViewController:controller animated:YES completion:nil];
    </li>

  3. Customize the controller:

    // Colors
    @property (strong, nonatomic) UIColor titleBarBackground;
    @property (strong, nonatomic) UIColor titleTextColor;
    @property (strong, nonatomic) UIColor *scrollIndicatorColor;

    // Font @property (strong, nonatomic) UIFont *titleFont;

    // Dimensions @property (assign, nonatomic) CGFloat titleBackgroundHeight; @property (assign, nonatomic) NSInteger titlePadding; @property (assign, nonatomic) NSInteger scrollIndicatorHeight; @property (assign, nonatomic) NSInteger defaultScrollIndicatorWidth;

    @property (assign, nonatomic) BOOL scrollIndicatorAutoFitTitleWidth;</pre>

    項目主頁:http://www.baiduhome.net/lib/view/home/1427783917428

    </li> </ol>

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!