- 浏览: 438739 次
- 性别:
- 来自: 广州
文章分类
- 全部博客 (538)
- C/C++ Primer (69)
- Objective-C Primer (102)
- Python Primer (19)
- JavaScript Primer (1)
- Java Primer (37)
- PHP Primer (17)
- 泛 Linux (37)
- Shell Script (21)
- APUE (21)
- UNP__1&2 (19)
- NetWork (7)
- Oracle周边 (38)
- Mysql里边 (6)
- Windows技 (9)
- 简单算法 & 数据结构 (14)
- 设计模式 (6)
- GTK历程 (12)
- 工具使用 (25)
- 杂事 (23)
- 一些概念 (17)
- Web方面 (10)
- myCodeTools (9)
- ^未 竟$ (13)
- 硬件通信 (2)
- Games (1)
最新评论
keyboard event
----------------------
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 5.0)
{
[[NSNotificationCenter defaultCenter] addObserver:[AppProperty sharedInstancd]
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillChangeFrameNotification
object:nil];
}
get keyboard height
----------------------
NSDictionary *userInfo = [notification userInfo];
NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
CGFloat height = [aValue CGRectValue].size.height;
contentInset & scroll
----------------------
UITableView *table = (UITableView *)[self superview];
NSIndexPath *indexPath = [table indexPathForCell:self];
CGFloat height = [[AppProperty sharedInstancd] keyboardHeight];
table.contentInset = UIEdgeInsetsMake(0, 0, height, 0);
[table scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionBottom
animated:YES];
UITableViewCellReorderControl 滑块
UITableViewCellDeleteConfirmationControl 删除
-----------------------
if([[[view class] description] isEqualToString:@"UITableViewCellReorderControl"])
{
UIView* resizedGripView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetMaxX(view.frame), CGRectGetMaxY(view.frame))];
[resizedGripView addSubview:view];
[self addSubview:resizedGripView];
CGSize sizeDifference = CGSizeMake(resizedGripView.frame.size.width - view.frame.size.width, resizedGripView.frame.size.height - view.frame.size.height);
CGSize transformRatio = CGSizeMake(resizedGripView.frame.size.width / view.frame.size.width, resizedGripView.frame.size.height / view.frame.size.height);
// Original transform
CGAffineTransform transform = CGAffineTransformIdentity;
// Scale custom view so grip will fill entire cell
transform = CGAffineTransformScale(transform, transformRatio.width, transformRatio.height);
// Move custom view so the grip's top left aligns with the cell's top left
transform = CGAffineTransformTranslate(transform, -sizeDifference.width / 2.0, -sizeDifference.height / 2.0);
[resizedGripView setTransform:transform];
for(UIImageView* cellGrip in view.subviews)
{
if([cellGrip isKindOfClass:[UIImageView class]])
[cellGrip setImage:nil];
}
}
UITableViewCellReorderControl 滑块
-----------------------
for (UIView * view in self.subviews)
{
if ([NSStringFromClass([view class]) rangeOfString: @"Reorder"].location != NSNotFound)
{
for (UIView * subview in view.subviews)
{
if ([subview isKindOfClass: [UIImageView class]])
{
((UIImageView *)subview).image = nil;
}
}
}
}
----------------------
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 5.0)
{
[[NSNotificationCenter defaultCenter] addObserver:[AppProperty sharedInstancd]
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillChangeFrameNotification
object:nil];
}
get keyboard height
----------------------
NSDictionary *userInfo = [notification userInfo];
NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
CGFloat height = [aValue CGRectValue].size.height;
contentInset & scroll
----------------------
UITableView *table = (UITableView *)[self superview];
NSIndexPath *indexPath = [table indexPathForCell:self];
CGFloat height = [[AppProperty sharedInstancd] keyboardHeight];
table.contentInset = UIEdgeInsetsMake(0, 0, height, 0);
[table scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionBottom
animated:YES];
UITableViewCellReorderControl 滑块
UITableViewCellDeleteConfirmationControl 删除
-----------------------
if([[[view class] description] isEqualToString:@"UITableViewCellReorderControl"])
{
UIView* resizedGripView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetMaxX(view.frame), CGRectGetMaxY(view.frame))];
[resizedGripView addSubview:view];
[self addSubview:resizedGripView];
CGSize sizeDifference = CGSizeMake(resizedGripView.frame.size.width - view.frame.size.width, resizedGripView.frame.size.height - view.frame.size.height);
CGSize transformRatio = CGSizeMake(resizedGripView.frame.size.width / view.frame.size.width, resizedGripView.frame.size.height / view.frame.size.height);
// Original transform
CGAffineTransform transform = CGAffineTransformIdentity;
// Scale custom view so grip will fill entire cell
transform = CGAffineTransformScale(transform, transformRatio.width, transformRatio.height);
// Move custom view so the grip's top left aligns with the cell's top left
transform = CGAffineTransformTranslate(transform, -sizeDifference.width / 2.0, -sizeDifference.height / 2.0);
[resizedGripView setTransform:transform];
for(UIImageView* cellGrip in view.subviews)
{
if([cellGrip isKindOfClass:[UIImageView class]])
[cellGrip setImage:nil];
}
}
UITableViewCellReorderControl 滑块
-----------------------
for (UIView * view in self.subviews)
{
if ([NSStringFromClass([view class]) rangeOfString: @"Reorder"].location != NSNotFound)
{
for (UIView * subview in view.subviews)
{
if ([subview isKindOfClass: [UIImageView class]])
{
((UIImageView *)subview).image = nil;
}
}
}
}
发表评论
-
float equal
2013-05-23 18:21 775- (BOOL)floatA:(float)f1 equalB ... -
Coding Guidelines for Cocoa
2013-05-17 16:53 629参考: https://developer.apple.com ... -
Cell
2013-05-16 14:32 745- (void)tableView:(UITableView ... -
Object-C编程规范
2013-05-15 10:49 6911.参考苹果的文档 “Coding Guidelines fo ... -
MacPorts
2013-02-28 18:12 568http://blog.csdn.net/lynjay/art ... -
KVC/KVO 监听对象属性变化
2013-01-10 23:09 7349http://blog.csdn.net/a6472953/a ... -
ios Associative 扩展属性
2013-01-08 16:45 1491@dynamic和@synthesize http://blo ... -
ObjC Dynamic
2013-01-08 15:21 738原文:http://www.onevcat.com/2012/ ... -
UIWebView
2012-10-24 11:06 711http://hi.baidu.com/wei_1123/it ... -
Device orientation
2012-10-15 16:20 693- (BOOL)shouldAutorotateToInter ... -
system notification
2012-10-12 15:22 588for UIApplication These notifi ... -
NSZombies
2012-08-09 08:51 626NSZombies搞定EXC_BAD_ACCESS http: ... -
Quartz 2D Programming Guide
2012-07-17 00:51 552Quartz 2D 内容不少啊 Graphics Trans ... -
NSCache
2012-07-12 14:25 710http://thenewself.blog.163.com/ ... -
NSCoding
2012-07-12 13:39 914@protocol NSCoding - (void ... -
分析 crash 报告的方法
2012-07-12 01:15 546http://blog.csdn.net/toss156/ar ... -
Multi-touch
2012-07-11 23:33 687智能与灵活与工作量>_< http://www.o ... -
iOS的多核编程和内存管理
2012-07-11 18:14 678http://anxonli.iteye.com/blog/1 ... -
NSCopying
2012-07-10 15:54 481http://www.apple.com.cn/develop ... -
NSTimeZone
2012-07-10 14:42 390http://developer.apple.com/libr ...
相关推荐
基于UITableView和UITextField实现的输入框下拉选择输入。
这是一个有输入框搜索功能的Demo,由UITableView和UITextField组合而成。但是之间有些地方处理的不太好,例如,输入汉字的时候,textfieldDelegate没有检测到,所以在项目中加入了定时器,以便每次的去刷新,检测...
title date tags UIMaker 2021-04-09 10:38:59 -0700 ...目前 支持创建 UILabel 、 UIButton 、 UIImageView 、 UITableView 、 UITextField 、UITextView 、UICollectionView 后续还会继续拓展 [Maker(UIMakerTypeLa
UITableView的使用方法及cell复用机制
上面主要是一个个的UITableViewCell,可以让UITableViewCell响应一些点击事件,也可以在UITableViewCell中加入UITextField或者UITextView等子视图,使得可以在cell上进行文字编辑。 UITableView中的cell可以有很多,...
源码BFKit,BFKit对常用于开发的类进行了扩展,整合了多个常用的控件和开发所需要的功能,是一个通用性的类库。... UITableView UITextField UIView UIWebView UIWindow BFKit: BFPassword BFSystemSound
UITableViewCell中按钮的点击事件、UITextField的输入事件、UISwitch等等都通过统一的CHGTableViewDidSelectRowBlock进行传输。 controller少了很多有关UITableViewDelegate以及UITableViewDatasource的相关代码,...
UITableViewCell中按钮的点击事件、UITextField的输入事件、UISwitch等等都通过统一的CHGTableViewDidSelectRowBlock进行传输。 controller少了很多有关UITableViewDelegate以及UITableViewDatasource的相关代码,...
本框架 基于swift UI(包括 UIImage,UItextfield,UIButton UITableView等) 实现UInavigation,UITabbar和页面的跳转
例如,当自省TextField ,它将: 将IntrospectionView添加为TextField的覆盖获取自省视图的视图宿主(位于UITextField的视图宿主旁边) 获取包含UITextField的上一个同级请注意,这种自省方法可能会在以后的SwiftUI...
当前,还在添加新的样式,请期待如何使用 let demoCategories = ["Menu", "Animation", "Transition", "TableView", "CollectionView", "Indicator", "Alert", "UIView", "UITextfield", "UITableView", "Swift", ...
关于如何在编辑过程中将UITextField和UITextView移出键盘的方式,有一百一UIKeyboardWillShowNotification提议的解决方案-通常归结为观察UIKeyboardWillShowNotification和UIKeyboardWillHideNotification ,或者...
表格视图(UITableView)7. 工具栏(UIToolBar)8. 导航栏(UINavigationBar)9. 标签栏(UITabBarController)10. 按钮(UIButton)11. 分段控件(UISegmentedControl)12. 文本字段(UITextField)13. 滑块...
因此要接收触摸事件(手势识别),必须设置userInteractionEnabled=YES(在iOS中UILabel、UIImageView的userInteractionEnabled默认都是NO,UIButton、UITextField、UIScrollView、UITableView等默认都是YES)。...
UIPickerView控件在给用户选择某些特定的数据时经常使用到,这里演示一个简单的选择数据,显示在UITextField输入框里,把UIPickerView作为输入View,用Toolbar作为选定数据的按钮。和其他UITableView控件相似,...
YWChainMakerUIKit控件的链式编程目前支持的控件UILabel/UIButton/UITextField/UITextView/UIImageView/UITableView的链式编程环境要求该库需运行在 iOS 8.0 和 Xcode 7.0以上环境.集成方法YWChainMaker 可以在中...
##Objectives 查看 UITableView 数据源和委托以及 UITextField 委托的原则。 通过 NSUserDefaults 添加存储,然后添加自定义模型对象。 ##Interface Builder 和文本字段委托 ###Step 1: 添加一个新的...
这份代码实现了具有 iOS 7 风格的扁平化UI控件,包括各种按钮(UIButton)、列表(UITableView)、Segments、UITextField等等。仅支持iOS 6.0 以上。 [优才 · Code4App]编译测试,适用环境:Xcode 4.5, iOS 6.0 ...
在这里,我已经使用UITextField + UITableView和CAAutoCompleteObject --model class编写了控件,您只需要创建[CAAutoFillTextField alloc] initWithFrame: CGRect]实例,或者将UIView拖放到情节...
//因为tag为999的本来就是UITextField类型所以可以强制转换成UITextField类型,如果他本来就不是UITextField,非要强转语法不会报错,但运行时就会出现问题(例如披着羊皮的郎) // UITextField *tf=(UITextField *...