TRZSlideLicenseViewController 是一个用于显示 CocoaPods 管理的许可证的 iOS 水平滚动视图控制器。
将以下行添加到您的 Podfile
。
pod 'TRZSlideLicenseViewController'
Pods-acknowledgements.plist
添加到您的项目中。TRZSlideLicenseViewController
。TRZSlideLicenseViewController
建立推送 segue 连接。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";
}
}
#import "TRZSlideLicenseViewController.h"
...
TRZSlideLicenseViewController *controller = [[TRZSlideLicenseViewController alloc] init];
controller.podsPlistName = @"Pods-acknowledgements.plist";
controller.navigationItem.title = @"Sample Licenses";
[self.navigationController pushViewController:controller animated:YES];
将以下值设置为 TRZSlideLicenseViewController
的 headerType
或 footerType
属性。
值 | 描述 |
---|---|
TRZSlideLicenseViewHeaderTypeDefault |
默认值。不执行任何事情。显示 CocoaPods 生成的标题和文本:“声明”,“本应用程序使用了以下第三方库:”。 |
TRZSlideLicenseViewHeaderTypeNone |
删除页眉页。 |
TRZSlideLicenseViewHeaderTypeCustom |
显示自定义文本。设置控制器属性中的 headerTitle 和 headerText 的文本。 |
值 | 描述 |
---|---|
TRZSlideLicenseViewFooterTypeDefault |
默认。无操作。显示 CocoaPods 生成的文本:“由 CocoaPods 生成 - https://cocoapods.org.cn”。 |
TRZSlideLicenseViewFooterTypeNone |
移除页脚。 |
TRZSlideLicenseViewFooterTypeCustom |
显示自定义文本。将文本设置为控制器属性的 footerTitle 和 footerText 。 |
将 UIColor
设置为 TRZSlideLicenseViewController
的 titleColor
或 textColor
属性。
...
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 许可证