TRZSlideLicenseViewController 0.9.6

TRZSlideLicenseViewController 0.9.6

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
Released最新发布2016年3月

86维护。



TRZSlideLicenseViewController 是一个用于显示 CocoaPods 管理的许可证的 iOS 水平滚动视图控制器。

TRZSlideLicenseViewController.gif

要求

安装

将以下行添加到您的 Podfile

pod 'TRZSlideLicenseViewController'

使用

将 Pods-acknowledgements.plist 添加到您的项目中

  1. 将 Pods 目录中的 Pods-acknowledgements.plist 添加到您的项目中。

从 Storyboard 加载视图

  1. 在您的 storyboard 中添加一个新的视图控制器。
  2. 在视图控制器的“身份检查器”的“自定义类”中输入 TRZSlideLicenseViewController
  3. 从导航控制器堆栈中的源视图控制器到 TRZSlideLicenseViewController 建立推送 segue 连接。
  4. 在 segue 设置的“属性检查器”中输入 segue 标识符。
  5. 在源视图控制器类文件中实现 prepareForSegue
#import "TRZSlideLicenseViewController.h"

...

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"segueIdentifier"]) {
        TRZSlideLicenseViewController *controller = segue.destinationViewController;
        controller.podsPlistName = @"Pods-acknowledgements.plist";
        controller.navigationItem.title = @"Sample Licenses";
    }
}

以编程方式创建视图

  1. 按照以下方式实现导航控制器堆栈中的源视图控制器。
#import "TRZSlideLicenseViewController.h"

...

TRZSlideLicenseViewController *controller = [[TRZSlideLicenseViewController alloc] init];
controller.podsPlistName = @"Pods-acknowledgements.plist";
controller.navigationItem.title = @"Sample Licenses";
[self.navigationController pushViewController:controller animated:YES];

选项

自定义页眉和页脚页的样式

将以下值设置为 TRZSlideLicenseViewControllerheaderTypefooterType 属性。

TRZSlideLicenseViewHeaderType

描述
TRZSlideLicenseViewHeaderTypeDefault 默认值。不执行任何事情。显示 CocoaPods 生成的标题和文本:“声明”,“本应用程序使用了以下第三方库:”。
TRZSlideLicenseViewHeaderTypeNone 删除页眉页。
TRZSlideLicenseViewHeaderTypeCustom 显示自定义文本。设置控制器属性中的 headerTitleheaderText 的文本。

TRZSlideLicenseViewFooterType

描述
TRZSlideLicenseViewFooterTypeDefault 默认。无操作。显示 CocoaPods 生成的文本:“由 CocoaPods 生成 - https://cocoapods.org.cn”。
TRZSlideLicenseViewFooterTypeNone 移除页脚。
TRZSlideLicenseViewFooterTypeCustom 显示自定义文本。将文本设置为控制器属性的 footerTitlefooterText

自定义标题和文本颜色

UIColor 设置为 TRZSlideLicenseViewControllertitleColortextColor 属性。

示例

...

TRZSlideLicenseViewController *controller = [[TRZSlideLicenseViewController alloc] init];
controller.podsPlistName = @"Pods-TESTTRZSlideView-acknowledgements.plist";
controller.navigationItem.title = @"Sample Licenses";

// Customize the header title and text.
controller.headerType = TRZSlideLicenseViewHeaderTypeCustom;
controller.headerTitle = @"Libraries We Use";
controller.headerText = @"This application makes use of the third party libraries on the following page (➟).\n\nWe thank the open source community for all of their contributions.";

// Remove the footer page.
controller.footerType = TRZSlideLicenseViewFooterTypeNone;

// Customize the colors
controller.view.backgroundColor = [UIColor darkGrayColor];
controller.view.tintColor = [UIColor colorWithRed:0.9 green:0.4 blue:0.4 alpha:1.0];
controller.titleColor = [UIColor whiteColor];
controller.textColor = [UIColor lightGrayColor];

[self.navigationController pushViewController:controller animated:YES];

许可证

MIT 许可证