iOS零零碎碎
来源:互联网 发布:c 编写unity3d脚本 编辑:程序博客网 时间:2024/06/05 19:19
一、数字键盘上添加移除按钮
- (void)handleKeyboardDidShow:(NSNotification *)notification
{
if (doneInKeyboardButton ==nil)
{
doneInKeyboardButton = [[UIButtonbuttonWithType:UIButtonTypeCustom]retain];
CGFloat screenHeight = [[UIScreenmainScreen] bounds].size.height;
if(screenHeight==568.0f){//爱疯5
doneInKeyboardButton.frame =CGRectMake(0, 568 -53, 106, 53);
}else{//3.5寸
doneInKeyboardButton.frame =CGRectMake(0, 480 -53, 106, 53);
}
doneInKeyboardButton.adjustsImageWhenHighlighted =NO;
//图片直接抠腾讯财付通里面的= =!
[doneInKeyboardButtonsetImage:[UIImageimageNamed:@"btn_done_up@2x.png"]forState:UIControlStateNormal];
[doneInKeyboardButtonsetImage:[UIImageimageNamed:@"btn_done_down@2x.png"]forState:UIControlStateHighlighted];
[doneInKeyboardButtonaddTarget:selfaction:@selector(finishAction)forControlEvents:UIControlEventTouchUpInside];
}
UIWindow* tempWindow = [[[UIApplicationsharedApplication] windows] objectAtIndex:1];
if (doneInKeyboardButton.superview ==nil)
{
[tempWindow addSubview:doneInKeyboardButton]; // 注意这里直接加到window上
}
}
- (void)handleKeyboardWillHide:(NSNotification *)notification
{
if (doneInKeyboardButton.superview)
{
[doneInKeyboardButtonremoveFromSuperview];
}
}
关闭键盘:
[[[UIApplicationsharedApplication] keyWindow] endEditing:YES];//关闭键盘
以上部分摘自code4app.com
- iOS零零碎碎
- 零零碎碎
- 零零碎碎
- 【Unity】零零碎碎
- python零零碎碎
- DOS GUI 零零碎碎
- 零零碎碎的总结
- postfix的一些零零碎碎
- LaTeX的零零碎碎记录
- 零零碎碎的总结
- JavaScript零零碎碎的知识点
- 零零碎碎的问题总结
- 零零碎碎(摘抄)
- 零零碎碎的模拟题
- C++ 学习零零碎碎 未完
- CSP课堂零零碎碎的笔记
- 零零碎碎的网站优化12点
- Java零零碎碎的笔记(一)
- 成员变量和方法变量
- 工作笔记——三表查询
- 不能频繁执行DBCC SHRINKDATABASE的原因
- iOS的init、loadView、 viewDidLoad、viewDidUnload的关系
- 使用函数与触发器 【数据库高效编程 - 学习笔记 第十章】
- iOS零零碎碎
- 基于SIFT+Kmeans+LDA的图片分类器的实现
- 黑马程序员:JAVA集合框架知识点一
- Using ArcGIS Server with a 64-bit processor
- linux驱动简单实例
- 可能不知道的Linux Shell
- js 数组Array用法
- DELPHI 解决DBGrid SHIFT键多选问题
- jQuery LigerUi 中的render使用