更新了跳轉(zhuǎn)崩潰的問(wèn)題秤茅。
_以前在Github上上傳個(gè)一個(gè)版本彻秆,后來(lái)居然有人給我點(diǎn)了幾顆星懈词,給我激動(dòng)的不得了蛇耀,然后這幾天沒(méi)事兒,就想著完善一下坎弯,然后就優(yōu)化了一下只希望能夠幫助你們纺涤,代碼水平一般译暂,歡迎吐槽_。
使用方法:
1.導(dǎo)入兩個(gè)文件(FKGPopOption.h&&.m)
2.在需要的地方添加如下代碼:
點(diǎn)擊這里下載源碼
// 由convertRect: toView 獲取到屏幕上該控件的絕對(duì)位置撩炊。
UIWindow *window = [[UIApplication sharedApplication].delegate window];
CGRect frame = [optionButton convertRect:optionButton.bounds toView:window];
FKGPopOption *s = [[FKGPopOption alloc] initWithFrame:self.view.bounds];
s.option_optionContents = @[@"首頁(yè)", @"個(gè)人中心", @"問(wèn)題一籮筐", @"任務(wù)管理",@"有獎(jiǎng)問(wèn)答"];
s.option_optionImages = @[@"select1",@"select2",@"select3",@"select4",@"select5"];
// 使用鏈?zhǔn)秸Z(yǔ)法直接展示 無(wú)需再寫(xiě) [s option_show];
[[s option_setupPopOption:^(NSInteger index, NSString *content) {
NSLog(@"你選中了第%ld行 選項(xiàng)為:%@", index, content);
} whichFrame:frame animate:YES] option_show];
源碼下載地址:https://github.com/forkingghost/FKGPopSelected
我的第二篇簡(jiǎn)書(shū)外永,希望能幫助到大家