博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 73 下一页

2011年11月23日

摘要: 键盘的显示很方便,但是键盘比较方便的隐藏就不是那么容易了看下图1呼出了键盘后,可以在键盘的右边添加一个按钮,如果用户想隐藏键盘,就点此按钮,就可以了。但是在IOS5的情况下,中文输入法在键盘右边的按钮就会被选词区遮盖了。请看图2隐藏键盘的按钮被系统的选词区遮盖了,基于这个状况,希望用户能够点击键盘区域以外的地方也能隐藏键盘。所以如何知道用户点击键盘以为区域就显得很重要了由于在ViewController中不能捕获以下Touch事件,以下Touch主要是针对UIView的- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)even 阅读全文
posted @ 2011-11-23 19:03 Likwo 阅读(3644) 评论(2) 推荐(1) 编辑

2011年11月22日

摘要: UIToolBar 三种办法方法一/toolBarbackgroundimagesetbasedoniOSversion[[UIDevicecurrentDevice]systemVersion];if([[[UIDevicecurrentDevice]systemVersion]floatValue]>4.9){//iOS5UIImage*toolBarIMG=[UIImageimageNamed:@"toolBar_brown.png"];if([toolBarrespondsToSelector:@selector(setBackgroundImage:forT 阅读全文
posted @ 2011-11-22 21:32 Likwo 阅读(6425) 评论(0) 推荐(0) 编辑

2011年11月10日

摘要: CGContextRef context = UIGraphicsGetCurrentContext();画一个正方形图形 没有边框CGContextSetRGBFillColor(context, 0, 0.25, 0, 0.5);CGContextFillRect(context, CGRectMake(2, 2, 270, 270));CGContextStrokePath(context);写文字CGContextSetLineWidth(context, 1.0);CGContextSetRGBFillColor (context, 1, 1, 1, 1.0);UIFont *fon 阅读全文
posted @ 2011-11-10 23:29 Likwo 阅读(6086) 评论(0) 推荐(0) 编辑

2011年11月1日

摘要: IOS 多线程 有三种主要方法(1)NSThread(2)NSOperation(3)GCD下面简单介绍这三个方法1.NSThread 调用方法如下: 如函数需要输入参数,可从object传进去。 (1) [NSThread detachNewThreadSelector:@selector(threadInMainMethod:) toTarget:self withObject:nil]; (2) NSThread* myThread = [[NSThread alloc] initWithTarget:self selector:@selector(threadInMain... 阅读全文
posted @ 2011-11-01 23:17 Likwo 阅读(6269) 评论(1) 推荐(6) 编辑

摘要: 解决方法如下dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSTimer* t = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(Reconnect:) userInfo:nil repeats:NO]; [[NSRunLoop currentRunLoop] addTimer:t forMode:NSDefaultRunLoopMode]; [[NSRun... 阅读全文
posted @ 2011-11-01 14:37 Likwo 阅读(2109) 评论(0) 推荐(0) 编辑

2011年10月30日

摘要: 采用UITableView显示从网络上下载的图片,因为网络图片下载比较耗费时间,一般采用边显示文字,内容,后台下载图片,下载完成后刷新TableViewCell ,本文将演示如何通过自定的UITableViewCell,显示图片。1。定义ImageTableViewCell@interfaceImageTableViewCell:UITableViewCell{UILabel*txtLabel;UIImageView*imageView;}@property(nonatomic,retain)IBOutletUILabel*txtLabel;@property(nonatomic,retain 阅读全文
posted @ 2011-10-30 21:43 Likwo 阅读(5479) 评论(4) 推荐(0) 编辑

2011年10月28日

摘要: Objective-C 和 SQLite 不支持中文拼音排序,这让中文应用的开发者非常郁闷 ,通过使用pingyin.h就能实现获取到字符首字母1。在数据库中为每个数据项加一个字段,用于存放汉字的汉语拼音首字母,比如 唐就是t,好就是h....这样就能用 SQL 语句对首字母进行排序了,其实就是根据拼音排序2。如何得到汉字的首字母呢?看 CocoaChina 以前的这篇教程帖 http://www.cocoachina.com/bbs/read.php?tid-38851-page-1.html。下载附件中代码,其实我们只需要 pinyin.h 和 pinyin.c 两个文件,将他们考到你的. 阅读全文
posted @ 2011-10-28 15:34 Likwo 阅读(2582) 评论(0) 推荐(0) 编辑

2011年10月25日

摘要: ElementSize (in points)Window (including status bar)320 x 480 ptsStatus Bar(How to hide the status bar)20 ptsView inside window(visible status bar)320... 阅读全文
posted @ 2011-10-25 11:53 Likwo 阅读(606) 评论(1) 推荐(0) 编辑

2011年10月21日

摘要: consistent hashing算法早在1997年就在论文Consistent hashing and random trees中被提出,目前在cache系统中应用越来越广泛;1基本场景比如你有N个cache服务器(后面简称cache),那么如何将一个对象object映射到N个cache上呢,你很可能会采用类似下面的通用方法计算object的hash值,然后均匀的映射到到N个cache;hash(object)%N一切都运行正常,再考虑如下的两种情况;1一个cache服务器m down掉了(在实际应用中必须要考虑这种情况),这样所有映射到cache m的对象都会失效,怎么办,需要把cach 阅读全文
posted @ 2011-10-21 16:12 Likwo 阅读(293) 评论(0) 推荐(0) 编辑

摘要: UIScrollView的相关概念首先介绍下UIScrollView的相关概念contentSize是scrollview可以滚动的区域,比如frame = (0 ,0 ,320 ,480) contentSize = (320 ,960),代表你的scrollview可以上下滚动,滚动区域为frame大小的两倍。contentOffset是scrollview当前显示区域顶点相对于frame顶点的偏移量,比如上个例子你拉到最下面,contentoffset就是(0 ,-480),也就是y偏移了- 480(注意向下拉,偏移是负数,向上才是正数,这个我测试过的)contentInset是scro 阅读全文
posted @ 2011-10-21 11:00 Likwo 阅读(5717) 评论(0) 推荐(0) 编辑

上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 73 下一页