天天看點

自定義 UIAlertView 之 BSYAlertView

一個自定義的UIAlertView,可以在修改樣式的UIAlertView,其中還有一個分類,在list無資料的時候提示使用,非常友善

下載下傳位址:https://github.com/baishiyun/BSYAlertView

使用方法:

1.bsy_Window的用法:導入#import "bsy_Window.h"

  • (void)viewDidLoad {[super viewDidLoad];

    self.view.backgroundColor = [UIColor whiteColor];self.title = @" bsy_Window 示範";UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];[button setFrame:CGRectMake([UIScreenmainScreen].bounds.size.width/3, [UIScreenmainScreen].bounds.size.height/2-30, [UIScreenmainScreen].bounds.size.width/3, 60)];[button setTitle:@"點選" forState:UIControlStateNormal];[button setTitleColor:[UIColor lightGrayColor]forState:UIControlStateNormal];[button.titleLabel setFont:[UIFont boldSystemFontOfSize:20]];button.backgroundColor = [UIColor brownColor];[self.view addSubview:button];[button addTarget:self action:@selector(buttonClick)forControlEvents:UIControlEventTouchUpInside];// Do any additional setup after loading the view, typically from anib.}

  • (void)buttonClick {

    bsy = [[bsy_Window alloc]initWithFrame:[UIScreenmainScreen].bounds];[bsy addBsy_quitBtnMessage:@"取消" sureMessage:@"确定" message:@"Do anyadditional setup after loading the view, typically from a nib. Do anyadditional setup after loading the view, typically from a nib. Do anyadditional setup after loading the view, typically from a nib."cueMessage:@"溫馨提示"];[self.view addSubview:bsy];[bsy.bsy_sureBtn addTarget:self action:@selector(bsy_Windowshow)forControlEvents:UIControlEventTouchUpInside];}-(void)bsy_Windowshow{bsy.hidden = YES;[self.navigationController pushViewController:[[TableViewControlleralloc]init] animated:NO];}

2.UITableView+bsy的用法:導入#import "UITableView+bsy.h"

  • (NSInteger)tableView:(UITableView *)tableViewnumberOfRowsInSection:(NSInteger)section {[tableView tableViewDisplayWithMeg:@"沒有商品資料"count:self.arr.count];return [self.arr count];}
  • 自定義 UIAlertView 之 BSYAlertView

繼續閱讀