LCActionSheet是添加到UIWindow效果
应用介绍
源码LCActionSheet,Demo提供“注销”和“修改头像”两个选项。点击注销时,下方弹出窗口请求确认;点击修改头像时,下方弹出窗口要求用户选择“拍照”、“从相册选择”或“取消”。 用法 - 把LCActionSheet文件夹(在Demo中)拖到你的项目中。 - 在相应位置导入头文件:#import "LCActionSheet.h",遵守协议。 - 调用下面的方法即可: [lang=objc] LCActionSheet *sheet = [[LCActionSheet alloc] initWithTitle:@"你确定要注销吗?" buttonTitles:@[@"确定"] redButtonIndex:0 delegate:self]; [sheet show]; [/lang] - 监听方法: [lang=objc]- (void)actionSheet:(LCActionSheet *)actionSheet didClickedButtonAtIndex:(int)buttonIndex { NSLog(@"> Clicked Index: %d", buttonIndex); } [/lang] Tips - LCActionSheet是添加到UIWindow上,没适配横屏。 - 提供了title、buttons、redButton、cancelBtn这些杂七杂八的东东,应该全了。 - buttonIndex从上到下从0依次递增。如果不想有redButton,在redButtonIndex:处传个-1即可。 - 协议能监听到点击的按钮的index,这个方法是可选实现的。 测试环境:Xcode 6.2,iOS 6.0以上

©软件著作权归作者所有。本站所有内容均来源于网络,不得违法使用,仅供学习使用,请支持正版!
转载请注明出处: 662P » LCActionSheet是添加到UIWindow效果
发表评论 取消回复