MM滚动演示器 0.0.4

MM滚动演示器 0.0.4

测试测试
语言语言 Obj-CObjective C
许可 MIT
发布上次发布2015年9月

Mitchell Malleo维护。



  • 作者
  • Mitch Malleo

描述

MM滚动演示器是一个用于iOS开发的控件,它接受一个MM滚动页面的数组,并在UIScrollView中显示它们。

我最初是受到《命运》应用中的控件的启发,所以我建议您也检查一下那个。

要求

  • ARC
  • iOS 5.0+

安装

  1. 您可以通过将pod 'MMScrollPresenter'添加到您的podfile中来通过Cocoapods安装MM滚动演示器,或者您可以手动包含MMScrollPresenter.h/.mMMScrollPage.h/.marrow/@2x.png到您的应用中。
  2. 在Interface Builder中添加一个UIScrollView,并在自定义类部分中将您的UIScrollView子类化为MM滚动演示器。
  3. 现在添加:@property (nonatomic, weak) IBOutlet MMScrollPresenter *mmScrollPresenter;到您的属性列表中,并在Interface Builder中将其链接起来。

使用

将MM滚动页面添加到MM滚动演示器中。

UIImageView *mountainImage = [[UIImageView alloc] initWithImage:[UIImage 
    imageNamed:@"mountains.jpg"]];

[mountainImage setFrame:CGRectMake(0, 0, self.mmScrollPresenter.frame.size.width, 
    self.mmScrollPresenter.frame.size.height)];

MMScrollPage *firstPage = [[MMScrollPage alloc] init];
firstPage.titleLabel.text = @"Look a picture of mountains";
firstPage.detailLabel.text = @"I'm the detail text";
[firstPage.backgroundView addSubview:mountainImage];
firstPage.titleBackgroundColor = 
    [UIColor colorWithRed:119/255.0f green:92/255.0f blue:166/255.0f alpha:0.5];

[self.mmScrollPresenter setupViewsWithArray:@[firstPage]];

贡献者

许可

MM滚动演示器可在MIT许可下使用。有关更多信息,请参阅LICENSE文件。