【代码笔记】iOS-轮询弹出框
一,效果图。
二,工程图。
三,代码。
RootViewController.m

#import "RootViewController.h"
//加入弹出框的头文件
#import "MPNotificationView.h" @interface RootViewController () @end @implementation RootViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
} - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view. self.title=@"RootViewController"; //弹出框前面有图片
[self showWithFrame];
//弹出框可以进行点击
[self showWithTouch]; }
#pragma -mark -可以点击的,点击后消息,并且可以在点击后添加事件
-(void)showWithTouch
{
[MPNotificationView notifyWithText:@"李华:"
detail:@"今天有时间吗?"
andTouchBlock:^(MPNotificationView *notificationView) { UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"已点击弹出框" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show]; }]; }
#pragma -mark -弹出框在前面有一张图片,然后,5.0s后自己会主动消失。没到5.0s点击的时候也会消失。
-(void)showWithFrame
{
[MPNotificationView notifyWithText:@"李华:"
detail:@"今天有时间吗?"
image:[UIImage imageNamed:@"1.jpeg"]
andDuration:5.0]; } - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

【代码笔记】iOS-轮询弹出框的更多相关文章
- 【代码笔记】iOS-自定义弹出框
代码: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [s ...
- 清除ios系统alert弹出框的域名
清除ios系统alert弹出框的域名 <script> window.alert = function(name) { var iframe = document.createElemen ...
- iOS风格的弹出框(alert,prompt,confirm)
前两天,自己写了一个简单的插件,在移动端使用,不管是安卓手机还是iOS系统的手机,弹出框统一使用iOS风格的. 该弹出框是依赖于jQuery的,当然也可以将用jq写的几句代码转换为原生代码. 今天把代 ...
- UIPresentationController - iOS自定义模态弹出框
参考: https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/Definin ...
- 【iOS】UIAlertController 弹出框
UIAlertView 虽然还能用,但已经废弃了.因此以后尽量用 UIAlertController.示例代码如下: UIAlertController *alert = [UIAlertContro ...
- iOS自定义提示弹出框(类似UIAlertView)
菜鸟一枚,大神勿喷.自己在牛刀小试的时候,发现系统的UIAlertView有点不喜欢,然后就自己自定义了一个UIAlertView,基本上实现了系统的UIAlertView,可以根据项目的需求修改UI ...
- IOS UIActionSheet(底部 弹出框的使用)
UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"确定要注销?" delegate:self cancel ...
- Python+Selenium笔记(九):操作警告和弹出框
#之前发的 driver.switch_to_alert() 这句虽然可以运行通过,但是会弹出警告信息(这种写法3.x不建议使用) 改成 driver.switch_to.alert就不会了. (一 ...
- JS组件系列——Bootstrap寒冬暖身篇:弹出框和提示框效果以及代码展示
前言:对于Web开发人员,弹出框和提示框的使用肯定不会陌生,比如常见的表格新增和编辑功能,一般常见的主要有两种处理方式:行内编辑和弹出框编辑.在增加用户体验方面,弹出框和提示框起着重要的作用,如果你的 ...
随机推荐
- BZOJ1179 Atm //缩点+spfa
1179: [Apio2009]Atm Description Input 第一行包含两个整数N.M.N表示路口的个数,M表示道路条数.接下来M行,每行两个整数,这两个整数都在1到N之间,第i+1行的 ...
- a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
错误一:安装Tomcat的时候出现了错误,这里要是找不到Tomcat6.0我们可以设置其enbale显示就可以,上面的错误解决办法: 错误二:在eclipse中启动Tomcat6.0的时候现在说800 ...
- Json.Net
下载地址:Json.NET 文档地址:Json.NET Documentation 基本的序列化与反序列化 public class Product { public string Name { ge ...
- No assembly found containing an OwinStartupAttribute
自从在ASP.NET MVC中使用NuGet添加SignalR类库之后,再次运行程序时,它出现了一个异常: Server Error in '/' Application. The following ...
- UWP游戏防内存修改器的方法
最近我一直在编写适用于Windows 10商店的游戏.这款游戏比较怕玩家用修改器改金钱,因为这种修改会导致某些内购失效并且损害公平性.于是我把自己见过的三种反修改器的方法给网友们介绍一下. 首先说明一 ...
- Winform 导入导出方法
导出时:引用 using Excel = Microsoft.Office.Interop.Excel; #region 读取excel //打开方法 public DataTable Excelto ...
- PowerDesigner中Table视图怎样同时显示Code和Name
1.创建一个简单table视图步骤: 1)打开软件,创建model,选择Physical Data
- jquery练习(一次性赋予多个属性值)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Spring、mybaits整合
mybatis.cfg.xml <!DOCTYPE configuration PUBLIC "-//mybatis.org/DTD Config 3.0//EN" &quo ...
- 【算法和数据结构】_11_小算法_itoa、ftoa及字符串倒置
[1]main.c /**************************************************** * * 把整数按照进制数转换为相应进制的字符串 *(要考虑符号),比如 ...