使用第三方类库(Toast+UIView)实现提示信息的显示

实现在.m文件中导入头文件:#import"Toast+UIView.h"

- (IBAction)changeColor:(id)sender {

//直接调用显示活动指示器的方法

[self.view makeToastActivity];

//做一个延时要处理的信息

[NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(show) userInfo:nil repeats:NO];

}

-(void)show

{

//将活动显示器隐藏

[self.view hideToastActivity];

//调用提示信息的方法

[self.view makeToast:@"这就是你要显示的信息" duration:2 position:@"center"];

}

你可能感兴趣的:(使用第三方类库(Toast+UIView)实现提示信息的显示)