测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可 | MIT |
Released最后发布 | 2016年3月 |
由 Muhammad Nabeel Arif 维护。
MNShowcaseView 可以突出显示您应用中的特定视图并对其描述,作为一个引导教程。它可以用作您应用中的引导教程,您可以告诉新用户他们如何使用您应用中的不同条目。
使用一个带有标题 + 信息的视图进行聚焦,简单易用
MNShowcaseView *showcaseViwe = [[MNShowcaseView alloc] initWithViewToFocus:self.button
title:@"Title String" description:@"Description String"];
[showcaseViwe showOnMainWindow];
或者使用带有多个视图及其标题 + 信息的 MNShowcaseView
MNShowcaseView *showcaseViwe = [[MNShowcaseView alloc] initWithViewsToFocus:@[slef.view1,self.view2]
title:@[@"Title 1",@"Title 2"] description:@[@"Description 1",@"Description 2"]];
// Add showcase view in current view controller.
[showcaseViwe showOnView:viewController.view];
或者使用具有关于聚焦视图详细设置的 MNShowcaseView
// Create MNShowcaseItem
MNShowcaseItem *item = [[MNShowcaseItem alloc] initWithViewToFocus:self.button
title:@"Title String" description:@"Description String"];
item.highlightedColor = [UIColor greenColor];
item.buttonTitle = @"DONE";
item.selectionType = MNSelection_Rectangle;
item.buttonPosition = MNButtonPosition_TopRight;
item.titleColor = [UIColor greenColor];
item.titleFont = [UIFont boldSystemFontOfSize:22];
item.descriptionColor = [UIColor yellowColor];
item.descriptionFont = [UIFont systemFontOfSize:18];
item.textViewPosition = MNTextViewPosition_Below;
// Create MNShowcaseView with MNShowcaseItem
MNShowcaseView *showcaseViwe = [[MNShowcaseView alloc] initWithShowcaseItem:item];
[showcaseViwe showOnMainWindow];
或者使用多个 MNShowcaseItems 的 MNShowcaseView
// Create MNShowcaseView with multiple MNShowcaseItem
MNShowcaseView *showcaseViwe = [[MNShowcaseView alloc] initWithShowcaseItems:@[item1,item2,item3]];
[showcaseViwe showOnMainWindow];
要处理和获取 MNShowcaseView 的事件,您可以实现以下协议。您还可以在 showView:willShowItem: 委托方法中将要显示的 MNShowcaseItem 进行自定义。
@protocol MNShowcaseViewDelegate <NSObject>
@optional
-(void)showcaseView:(MNShowcaseView*)showcaseView willShowItem:(MNShowcaseItem*)showcaseItem;
-(void)showcaseViewWillDismiss:(MNShowcaseView*)showcaseView;
-(void)showcaseView:(MNShowcaseView *)showcaseView isTappedAtPoint:(CGPoint)point isInsideSelectedArea:(BOOL)isInside;
@end
Muhammad Nabeel Arif
MNShowcaseView 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。