08 2012 档案

摘要:UITableView的强大更多程度上来自于可以任意自定义UITableViewCell单元格。通常,UITableView中的Cell是 动态的,在使用过程中,会创建一个Cell池,根据每个cell的高度(即tableView:heightForRowAtIndexPath:返回 值),以及屏幕高度计算屏幕中可显示几个cell。而进行自定义TableViewCell无非是采用代码实现或采用IB编辑nib文件来实现两种方式, 本文主要收集代码的方式实现各种cell自定义。如何动态调整Cell高度-(UITableViewCell*)tableView:(UITableView*)tableVi 阅读全文
posted @ 2012-08-07 13:24 奔放小青年 阅读(29953) 评论(0) 推荐(1)
摘要:在 iPhone 或 iPad 的开发中,除了用touchesBegan / touchesMoved / touchesEnded这组方法来控制使用者的手指触控外,也可以用UIGestureRecognizer的衍生类別来进行判断。用UIGestureRecognizer的好处在于有现成的手势,开发者不用自己计算手指移动轨迹。UIGestureRecognizer的衍生类別有以下几种:UITapGestureRecognizerUIPinchGestureRecognizerUIRotationGestureRecognizerUISwipeGestureRecognizerUIPanGes 阅读全文
posted @ 2012-08-06 11:22 奔放小青年 阅读(391) 评论(0) 推荐(0)
摘要:1,获取翻转事件,并开启翻转:只要在viewcontroller的类中加入-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{//翻转后要执行的代码return YES;}2,-(void)viewWillAppear:(BOOL)animated,- (void)viewDidLoad 的区别。viewwillappear是每次视图控制器的视图出现前执行的代码。而viewdidload是每次视图控制器载入是执行的代码。比如说:当a视图控制器的视图第一次出现是两 阅读全文
posted @ 2012-08-06 11:17 奔放小青年 阅读(4368) 评论(0) 推荐(3)
摘要:来自:http://www.dreamingwish.com/dream-2011/apples-third-party-development-libraries-asihttprequest.html第三方苹果开发库之ASIHTTPRequestASIHttpRequest库简介、配置和安装ASIHttpRequest-创建和执行requestASIHttpRequest-发送数据ASIHTTPRequest-下载数据ASIHTTPRequest-进度追踪ASIHTTPRequest-身份验证ASIHTTPRequest-HTTP授权-流程图ASIHTTPRequest-Cookie的使用 阅读全文
posted @ 2012-08-03 18:01 奔放小青年 阅读(11448) 评论(0) 推荐(2)
摘要:给下面一个这样的字符串去处理让人好头大,在java里的处理貌似很简单, ArrayList<String>貌似就解决的差不多了NSString*str=@"0000##17#4#32@?????????????@002@@2010-03-1611:25:24.834259*31@??????????????@002@@2009-12-15 15:51:57.203038*30@????????????????????@002@@2009-12-1222:04:52.985329*29@?????917????6?11????1660@002@@2009-12-1222:0 阅读全文
posted @ 2012-08-03 17:32 奔放小青年 阅读(11142) 评论(0) 推荐(0)
摘要:来自:http://blog.sina.com.cn/s/blog_85c1f6a50100zadl.html加载MFMessageComposeViewController- (void)showMessageView{if( [MFMessageComposeViewControllercanSendText] ){MFMessageComposeViewController* controller = [[MFMessageComposeViewControlleralloc]init];//autorelease];controller.recipients= [NSArrayarra 阅读全文
posted @ 2012-08-03 17:24 奔放小青年 阅读(1211) 评论(0) 推荐(0)
摘要:来自:http://blog.csdn.net/bl1988530/article/details/6597230iPhoneAPI已经提供了系统写邮件界面的接口,使用MFMailComposeViewController,用来显示界面. 项目中需要添加MessageUi.framework。头文件加入MFMailComposeViewControllerDelegate。#import<MessageUI/MessageUI.h> sendMailViewController.m文件的实现: -(void)viewDidLoad{UIButton*button=[UIButton 阅读全文
posted @ 2012-08-03 17:12 奔放小青年 阅读(2318) 评论(0) 推荐(0)
摘要:来自:http://blog.csdn.net/shijiucdy/article/details/7364143-(void)viewDidLoad{ UISwipeGestureRecognizer*recognizer; recognizer = [[UISwipeGestureRecognizeralloc]initWithTarget:selfaction:@selector(handleSwipeFrom:)]; [recognizersetDirection:(UISwipeGestureRecognizerDirectionRight)]; [[selfview]addG... 阅读全文
posted @ 2012-08-03 16:55 奔放小青年 阅读(5286) 评论(0) 推荐(0)
摘要:来自:http://www.devdiv.com/thread-69786-1-1.htmlUILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification!=nil) { NSDate *now=[NSDate new]; //notification.fireDate=[now addTimeInterval:period]; notification.fireDate = [now dateByAddingTimeInterval:period]... 阅读全文
posted @ 2012-08-02 10:28 奔放小青年 阅读(457) 评论(0) 推荐(0)
摘要:来自:http://www.devdiv.com/thread-67521-1-1.html最近看这个比较多人用到,以前有使用过,现在,粘过来给大伙看看.注意:UIImageView的大小只能跟图片一样大.要不然取色不对.- (UIColor *) getPixelColorAtLocation:(CGPoint)point { UIColor* color = nil; CGImageRef inImage = self.image.CGImage; // Create off screen bitmap context to draw the image into. Fo... 阅读全文
posted @ 2012-08-02 10:20 奔放小青年 阅读(957) 评论(0) 推荐(0)
摘要:来自:http://www.devdiv.com/thread-38136-1-1.html核心函数是:CGContextAddArc(CGContextRef c, CGFloat x, CGFloat y, CGFloat radius, CGFloat startAngle, CGFloat endAngle, int clockwise) * CGContextRef: 图形上下文 * x,y: 开始画的坐标 * radius: 半径 * startAngle, endAngle: 开始的弧度,结束的弧度 * clockwise: 画的方向(顺时针,逆时针)有了这个函数可以画... 阅读全文
posted @ 2012-08-02 10:10 奔放小青年 阅读(457) 评论(0) 推荐(0)
摘要:来自:http://www.devdiv.com/home.php?mod=space&uid=8639&do=blog&id=4104iphone ipad 开发:结合UIImageView实现图片的移动和缩放因为种种原因,需要在iphone应用中实现图片查看功能,由于iphone屏幕支持多点触摸,于是是想到用“手势”来实现图片的实时缩放和移动。借鉴无所不在的internet网络资料之后,终于实现此一功能,过程如下。一、首先实现原图显示(不缩放)新建MoveScaleImageView类,继承uiview。用于加载一个UIImage。它有两个主要的成员,一个UIIma 阅读全文
posted @ 2012-08-02 09:50 奔放小青年 阅读(992) 评论(0) 推荐(0)
摘要:一、UITextField(1)初始化UITextFieldUITextField* text = [[UITextField alloc] initWithFrame:CGRectMake(10, 50, 300, 30)]; text.borderStyle = UITextBorderStyleRoundedRect; text.autocorrectionType = UITextAutocorrectionTypeYes; text.placeholder = @"XXXXXXX"; text.returnKeyType = UIReturnKeyDone; .. 阅读全文
posted @ 2012-08-01 18:19 奔放小青年 阅读(560) 评论(0) 推荐(0)