最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
IOS数字键盘左下角添加完成按钮的实现方法
时间:2017-08-25 编辑:猪哥 来源:一聚教程网
实现代码:
- (void)addDoneButtonToNumPadKeyboard { UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom]; if(systemVersion < 8.0){ doneButton.frame = CGRectMake(0, 163, 106, 53); }else{ doneButton.frame = CGRectMake(0, SCREEN_SIZE.height-53, 106, 53); } doneButton.tag = NUM_PAD_DONE_BUTTON_TAG; doneButton.adjustsImageWhenHighlighted = NO; [doneButton setTitle:@"完成"forState:UIControlStateNormal]; [doneButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [doneButton addTarget:self action:@selector(doneButton:) forControlEvents:UIControlEventTouchUpInside]; NSArray *windowArr = [[UIApplication sharedApplication] windows]; if(windowArr != nil && windowArr.count > 1){ UIWindow *needWindow = [windowArr objectAtIndex:1]; UIView *keyboard; for(inti = 0; i < [needWindow.subviews count]; i++) { keyboard = [needWindow.subviews objectAtIndex:i]; NSLog(@"%@", [keyboard description]); if(([[keyboard description] hasPrefix:@"1){ UIWindow *needWindow = [windowArr objectAtIndex:1]; UIView *keyboard; for(inti = 0; i < [needWindow.subviews count]; i++) { keyboard = [needWindow.subviews objectAtIndex:i]; if(([[keyboard description] hasPrefix:@"
-
上一个: 齿轮逻辑难题第158关通关攻略
-
下一个: 微信小程序如何快速填写手机号
相关文章
- iOS中延时执行的几种方式比较及汇总 02-13
- iOS 在线视频生成GIF图功能的方法 02-09
- IOS安装包比Android容量大的原因 02-08
- iOS 生成plist文件,在项目中代码创建plist的实例 02-02
- ios Plist文件怎么配置 02-02
- React Native中NavigatorIOS组件的简单使用详解 01-29