程式碼demo
已在Github
開源, MXActionSheet, 如果幫助到您,點個星star哈!
MXActionSheet
是一個從底部上來的彈窗控制元件,仿微信裡操作一樣!
螢幕截圖
一個底部標題 | 兩個底部標題 | 刪除底部標題 | 超過兩個底部標題 |
---|---|---|---|
如何使用
一個底部標題
[MXActionSheet showWithTitle:@"MXActionSheet Supporting bellow Styles" cancelButtonTitle:@"cancel" destructiveButtonTitle:nil otherButtonTitles:@[@"title 1st"] selectedBlock:^(NSInteger index) {
NSLog(@"------> index: %ld", index);
}];
複製程式碼
兩個底部標題
[MXActionSheet showWithTitle:@"MXActionSheet Supporting bellow Styles" cancelButtonTitle:@"cancel" destructiveButtonTitle:nil otherButtonTitles:@[@"title 1st", @"title 2nd"] selectedBlock:^(NSInteger index) {
NSLog(@"------> index: %ld", index);
}];
複製程式碼
刪除底部標題
[MXActionSheet showWithTitle:@"MXActionSheet Supporting bellow Styles" cancelButtonTitle:@"cancel" destructiveButtonTitle:@"destructive titles" otherButtonTitles:@[@"title 1st", @"title 2nd"] selectedBlock:^(NSInteger index) {
NSLog(@"------> index: %ld", index);
}];
複製程式碼
超過兩個底部標題
[MXActionSheet showWithTitle:@"MXActionSheet Supporting bellow Styles" cancelButtonTitle:@"cancel" destructiveButtonTitle:nil otherButtonTitles:@[@"title 1st", @"title 2nd", @"title 3th"] selectedBlock:^(NSInteger index) {
NSLog(@"------> index: %ld", index);
}];
複製程式碼