通知提示SCPromptView
SCPromptView
SCPromptView : 显示在顶部的提示控件
你的star是我最大的动力
安装
手动安装
下载源码,将SCPromptView
文件夹拖进项目
CocoaPod
pod 'SCPromptView'
使用
SCPromptView 的用法,与tableView相似
创建view
#import "SCPromptView.h"@interface TestPromptView : SCPromptView@end
#import "TestPromptView.h"@interface TestPromptView()
/*** label*/
@property (nonatomic,strong)UILabel *textLabel;
@end@implementation TestPromptView
//初始化子控件
-(void)sc_setUpCustomSubViews{self.backgroundColor= [UIColor colorWithRed:(arc4random()%255)/255.f green:(arc4random()%255)/255.f blue:(arc4random()%255)/255.f alpha:1];UILabel *textLabel = [[UILabel alloc]initWithFrame:self.contentView.bounds];textLabel.textColor = [UIColor whiteColor];textLabel.textAlignment = NSTextAlignmentCenter;[self.contentView addSubview:textLabel];self.textLabel = textLabel;
}
//读取参数
-(void)sc_loadParam:(id)param{NSString *text = param;self.textLabel.text = text;
}
@end
重写两个基础方法
注册
SCPROMPT_REGISTER([TestPromptView class],@"test")
SCPROMPT_REGISTER([ResultPromptView class], @"result")
发送显示命令
///随机颜色显示
-(void)clickBtn:(id)sender{NSString * text =[NSString stringWithFormat:@"%d",_num];SCPROMPT_SHOW(@"test",text)_num++;
}
其他Api
@protocol SCPromptViewDelegate <NSObject>
@required
/*** @brief 添加自定义的子控件*/
-(void)sc_setUpCustomSubViews;
/*** @brief 子控件读取数据*/
-(void)sc_loadParam:(id)param;@optional
/*** @brief 显示时间*/
-(NSTimeInterval)sc_showTime;
/*** @brief 滑动距离*/
-(CGFloat)sc_slideDistance;
/*** @brief 震动距离*/
-(CGFloat)sc_shakeDistance;
/*** @brief 出现动画时间*/
-(NSTimeInterval)sc_showAnimationDuration;
/*** @brief 隐藏动画时间*/
-(NSTimeInterval)sc_hideAnimationDuration;
/*** @brief 即将执行由手势触发的隐藏* @return yes 隐藏 / no 不隐藏*/
-(BOOL)sc_willHideByTap;@end
SCPromptView
SCPromptView : A prompt view which show in the top of the screen .
your star is my biggest motivation
Install
Manually
Download the source code , copy folder SCPromptView
into your project.
CocoaPod
pod 'SCPromptView'
Usage
The usage of SCPromptView is similar to the usage of UITableView.
Create Custom View
#import "SCPromptView.h"@interface TestPromptView : SCPromptView@end
#import "TestPromptView.h"@interface TestPromptView()
/*** label*/
@property (nonatomic,strong)UILabel *textLabel;
@end@implementation TestPromptView
//setUp subviews
-(void)sc_setUpCustomSubViews{self.backgroundColor= [UIColor colorWithRed:(arc4random()%255)/255.f green:(arc4random()%255)/255.f blue:(arc4random()%255)/255.f alpha:1];UILabel *textLabel = [[UILabel alloc]initWithFrame:self.contentView.bounds];textLabel.textColor = [UIColor whiteColor];textLabel.textAlignment = NSTextAlignmentCenter;[self.contentView addSubview:textLabel];self.textLabel = textLabel;
}
//loadParam which you deliver via command
-(void)sc_loadParam:(id)param{NSString *text = param;self.textLabel.text = text;
}
@end
Override two basic function.
Register
SCPROMPT_REGISTER([TestPromptView class],@"test")
SCPROMPT_REGISTER([ResultPromptView class], @"result")
发送显示命令
///show random color
-(void)clickBtn:(id)sender{NSString * text =[NSString stringWithFormat:@"%d",_num];SCPROMPT_SHOW(@"test",text)_num++;
}
Other Api
@protocol SCPromptViewDelegate <NSObject>
@required
/*** @brief 添加自定义的子控件*/
-(void)sc_setUpCustomSubViews;
/*** @brief 子控件读取数据*/
-(void)sc_loadParam:(id)param;@optional
/*** @brief 显示时间*/
-(NSTimeInterval)sc_showTime;
/*** @brief 滑动距离*/
-(CGFloat)sc_slideDistance;
/*** @brief 震动距离*/
-(CGFloat)sc_shakeDistance;
/*** @brief 出现动画时间*/
-(NSTimeInterval)sc_showAnimationDuration;
/*** @brief 隐藏动画时间*/
-(NSTimeInterval)sc_hideAnimationDuration;
/*** @brief 即将执行由手势触发的隐藏* @return yes 隐藏 / no 不隐藏*/
-(BOOL)sc_willHideByTap;@end
通知提示SCPromptView相关推荐
- php通知前端,HTML5桌面通知提示功能的实现
HTML5赋予网页更好的意义和结构.更加丰富的标签将随着对RDFa的,微数据与微格式等方面的支持,构建对程序.对用户都更有价值的数据驱动的Web.本文我们就和大家分享HTML5实现桌面通知提示功能. ...
- 安卓html5桌面提醒,HTML5桌面通知提示功能的实现
HTML5赋予网页更好的意义和结构.更加丰富的标签将随着对RDFa的,微数据与微格式等方面的支持,构建对程序.对用户都更有价值的数据驱动的Web.本文我们就和大家分享HTML5实现桌面通知提示功能. ...
- Android Service下载文件并自定义通知提示下载
最近要做一个更新sdk,里面用到了service后台下载,自定义通知提示下载进度,下面直接贴上代码. 下面是UpdateUtils.java ,告诉你如何使用 package com.cnziz.up ...
- iPhone 13锁屏无法收到微信通知提示怎么解决?
相信有很多小伙伴已经入手了iPhone 13,但是出现了很多问题.今天小编就来介绍一下怎么解决微信锁屏后收不到消息. 近日,一些iPhone 13和iPhone 13 Pro系列机型的用户反馈手机在锁 ...
- android8.1 屏蔽通知提示
注意区分通知和广播 在通知服务中 frameworks/base/services/core/java/com/android/server/notification/NotificationMana ...
- 怎么去除小米手机通知提示音
1,打开手机,进入设置页面 2,选择声音和振动 3,选择默认通知提示音->选择铃声->选无 说明:在小米手机上测试的,其他版本手机应该是类似的.
- 通知提示音修改默认铃声
近日有个需求:用户要求把手机通知的提示音改为默认的手机铃声,改了好久终于做出了,做个记录. 代码如下: /*** 启动通知*/public void showNotification(CharSequ ...
- 雷鸟客户端关闭后有新邮件通知提示插件——雷鸟最小化插件
插件效果: 如上图. 插件作用:最小化或关闭后,保留在右下角工具栏中,新邮件仍有提示. 插件名称:MinimizeToTray Reanimated ps:这个插件不适用于 ver 68.6.0以上版 ...
- vue 使用vuex实现消息通知提示
需求如图:因为这两个不存在组件关系,所以我们使用Vuex来解决这个实时刷新 1.首先在vuex的state定义数据如下 state: {noticeCount: 0}, 2.更改 Vuex 的 sto ...
最新文章
- ROS创建工作空间与节点
- Concurrent包下的常用并发类和普通类之间的区别
- nmf算法 python_NMF算法简介及python实现
- DynamoRIO工作原理
- P3399 丝绸之路(线性二维dp)
- [导入]Asp.Net 学习资源列表
- c#教程与视频教程类专题资料免费下载整理合集
- 卸载干净ARCGIS不用手动删注册表,一键用GEEK
- Ubuntu 10.04 使用libfetion
- 用scrapy-splash爬取淘宝
- 为什么微博超话显示服务器有点累,微博超话帖子被吞是什么原因?使用时,注意这些事项...
- PyTorch-LSTM时间序列预测中如何预测真正的未来值
- bbr29_TCP BBR导致性能下降
- java项目设计与思路
- 基本面分析中必须了解的88条避雷常识
- 后端框架之Flask--初识
- 使用docker安装ubuntu镜像
- 单词接龙acwing
- ADO数据库连接中的Integrated Security和Persist Security Info参数的作用
- 从技术趋势看质量赋能