随笔分类 -  iOS开发

上一页 1 ··· 6 7 8 9 10 11 下一页
呼呼
摘要:IOS系统框架提供的两种发送Email的方法:openURL 和 MFMailComposeViewController。借助这两个方法,我们可以轻松的在应用里加入如用户反馈这类需要发送邮件的功能。1.openURL使用openURL调用系统邮箱客户端是我们在IOS3.0以下实现发邮件功能的主要手段。我们可以通过设置url里的相关参数来指定邮件的内容,不过其缺点很明显,这样的过程会导致程序暂时退出。下面是使用openURL来发邮件的一个小例子:#pragmamark-使用系统邮件客户端发送邮件-(void)launchMailApp { NSMutableString*mailUrl=[[[N 阅读全文
posted @ 2012-07-30 17:40 GreyWolf 阅读(248) 评论(0) 推荐(0)
摘要:googlecode http://code.google.com/p/skpsmtpmessage/svn checkout http://skpsmtpmessage.googlecode.com/svn/trunk/ skpsmtpmessage-read-onlygithub:git clone https://github.com/kailoa/iphone-smtp.gitskpsmtpmessage 是由Skorpiostech, Inc.为我们带来的一个SMTP协议的开源实现,使用Objective-c 实现,iOS系统的项目可以直接调用 =]skpsmtpmessage能够实 阅读全文
posted @ 2012-07-30 17:13 GreyWolf 阅读(385) 评论(0) 推荐(0)
摘要:寫iOS App我最怕遇到的三樣處理, 大概就是1.影音, 2.網路 3.圖片沒了這三樣還能叫App嗎? 大概是我coding功力不夠吧今天來講講圖片的處理...圖片的處理大概就分這幾樣了截圖(capture), 縮放(scale),設定大小(resize), 儲存(save)這幾樣比較好處理, 另外還有濾鏡, 擦拭等, 以後再說在這個Demo code裡, 我寫了幾個方法1.等比率縮放- (UIImage *)scaleImage:(UIImage *)imagetoScale:(float)scaleSize{UIGraphicsBeginImageContext(CGSizeMake(i 阅读全文
posted @ 2012-07-30 16:19 GreyWolf 阅读(171) 评论(0) 推荐(0)
摘要:这段“许靖昕”先生分享的代码将示范如何缩小 UIImage@implementationUIImage(Extras)#pragmamark-#pragmamarkScaleandcropimage-(UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize{UIImage*sourceImage=self;UIImage*newImage=nil;CGSizeimageSize=sourceImage.size;CGFloatwidth=imageSize.width;CGFloatheight=imageSize.height 阅读全文
posted @ 2012-07-30 15:50 GreyWolf 阅读(138) 评论(0) 推荐(0)
摘要:+ (void)alert:(NSString *)msg{ UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:msg message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] autorelease]; [alertView showWithBackground];}+ (void) makeCall:(NSString *)phoneNumber{ if ([DeviceDetect 阅读全文
posted @ 2012-07-30 15:11 GreyWolf 阅读(290) 评论(0) 推荐(0)
摘要:导入MessageUI.framework.h文件中#import<MessageUI/MessageUI.h>#import<MessageUI/MFMailComposeViewController.h>实现MFMailComposeViewControllerDelegate,MFMessageComposeViewControllerDelegate.m文件//邮件-(void)showMailPicker { ClassmailClass = (NSClassFromString(@"MFMailComposeViewController" 阅读全文
posted @ 2012-07-30 14:47 GreyWolf 阅读(312) 评论(0) 推荐(0)
摘要:邮件发送功能是由MessageUI Framework提供的,这个框架是iPhone sdk中最简单的框。由一个类、一个视图控制器,一个protocol组成。一、创建视图控制器:MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init]; mc.mailComposeDelegate = self; 二、设置邮件主题: [mc setSubject:@"Hello, World!"];三、设置收件人,收件人有三种:1、设置主收件人[mc setToRecipients:[NSArr 阅读全文
posted @ 2012-07-30 14:40 GreyWolf 阅读(181) 评论(0) 推荐(0)
摘要:Math.round:如果参数是小数,则求本身的四舍五入。Math.ceil:如果参数是小数,则求最小的整数但不小于本身.Math.floor:如果参数是小数,则求最大的整数但不大于本身. 阅读全文
posted @ 2012-07-28 11:11 GreyWolf 阅读(180) 评论(0) 推荐(0)
摘要:将字符串声明称@property(copy, nonatomic),因为MKAnnotation的title等的字符串是copy不是retain的。 阅读全文
posted @ 2012-07-27 16:33 GreyWolf 阅读(162) 评论(0) 推荐(0)
摘要:如果要移除一个 UIView 的所有子视图,SDK 里没有 remove all 之类的方法。可以用 for loop 循环调用 – removeFromSuperview 来移除 例如:for(UIView *view in [self.view subviews]){ [view removefromsuperview]}除了遍历移除subView 还可以用这个方法:[[self.view subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; 阅读全文
posted @ 2012-07-27 12:11 GreyWolf 阅读(279) 评论(0) 推荐(0)
摘要:转自:http://langhua9527.iteye.com/blog/1377741如果想调用某个类的某个方法可以写成这样,这个方法来自NSObject类C代码performSelector:performSelector:withObject:performSelector:withObject:withObject:实际调用C代码[selfperformSelector:@selector(displayViews)withObject:nilafterDelay:1.0f]; 有三个方法分别是C代码//父视图[self.viewsuperview]//所有子视图[self.views 阅读全文
posted @ 2012-07-27 12:10 GreyWolf 阅读(190) 评论(0) 推荐(0)
摘要:tap是指轻触手势。类似鼠标操作的点击。从iOS 3.2版本开始支持完善的手势api:tap:轻触long press:在一点上长按pinch:两个指头捏或者放的操作pan:手指的拖动swipe:手指在屏幕上很快的滑动rotation:手指反向操作这为开发者编写手势识别操作,提供了很大的方便,想想之前用android写手势滑动的代码(编写android简单的手势切换视图示例),尤其感到幸福。这里写一个简单的tap操作。在下面视图的蓝色视图内增加对tap的识别:当用手指tap蓝色视图的时候,打印日志输出:代码很简单,首先要声明tap的recognizer:UITapGestureRecogniz 阅读全文
posted @ 2012-07-17 10:57 GreyWolf 阅读(281) 评论(0) 推荐(0)
摘要:Quartz转换实现的原理:Quartz把绘图分成两个部分, 用户空间,即和设备无关, 设备空间,用户空间和设备空间中间存在一个转换矩阵 : CTM本章实质是讲解CTMQuartz提供的3大功能移动,旋转,缩放演示如下,首先加载一张图片void CGContextDrawImage ( CGContextRef c, CGRect rect, CGImageRef image );移动函数CGContextTranslateCTM (myContext, 100, 50);旋转函数include <math.h> static inline double radians (d... 阅读全文
posted @ 2012-07-17 10:17 GreyWolf 阅读(284) 评论(0) 推荐(0)
摘要:CLLocationManager获取所在城市- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {//获取所在地城市名 CLGeocoder *geocoder=[[CLGeocoder alloc]init]; [geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray ... 阅读全文
posted @ 2012-07-17 10:16 GreyWolf 阅读(724) 评论(0) 推荐(0)
摘要:具体的效果就是点击callout中的rightCalloutAccessoryView(一个button)后,callout窗口以动画效果缩小,消失后又逐渐展开一个Popover.我的代码是这样的:- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView<MKAnnotation> *)viewcalloutAccessoryControlTapped:(UIControl *)control {//[view dismissModalViewControllerAnimated:YES];NSArr 阅读全文
posted @ 2012-07-11 19:38 GreyWolf 阅读(272) 评论(0) 推荐(0)
摘要:1-view controllers的关系:Each custom view controller manages a distinct view hierarchy but a navigation controller coordinates the navigation between different view hierarchies.2-Navigation Interface中的对象你不能改变navigation controller的navigation bar和toolbar对象,navigation controller对象自己负责配置和显示它们。此外,navigation 阅读全文
posted @ 2012-07-09 13:55 GreyWolf 阅读(218) 评论(0) 推荐(0)
摘要:iOS的控件,只看到UIButton可以设置 Padding/Insets,即按钮上文字或图片与按钮边界的间隙,对与CSS来说叫做 Padding,在iOS中叫做Insets,UIButton设置Insets相应的属性如下:Configuring Edge Insets contentEdgeInsets property titleEdgeInsets property imageEdgeInsets property它们接受的属性类型是:UIEdgeInsets,由函数 UIEdgeInsetsMake ( CGFloat top, CGFloat left, CGFloat bottom 阅读全文
posted @ 2012-07-05 11:55 GreyWolf 阅读(387) 评论(0) 推荐(0)
摘要:iOS开发应用中关于图形和绘制案例讲解是本文要介绍的内容,主要是来学习IOS开发中关于绘图的一些要注意的细节,否则实现不了效果。具体内容来看详细内容。1、iOS支持OpenGL ES和Quartz/UIKit/CoreAnimation绘制接口。UIKit绘制必须在主线程中完成。2、Quartz支持基于路径的绘制,反走样,填充,图像,上色,坐标变换,pdf绘制显示解析等功能。3、UIKit支持线条绘制、图像和颜色操作。4、Core Animation支持动画绘制。5、View的使用DrawRect绘制,以下行为会触发:(1)View的移动和遮挡。(2)View的隐藏和显示。(3)拖动View。 阅读全文
posted @ 2012-07-05 10:23 GreyWolf 阅读(254) 评论(0) 推荐(0)
摘要:摘要: 一.基本方式:使用UIView类的UIViewAnimation扩展函数说明+ (void)beginAnimations:(NSString *)animationID context:(void *)context; // 开始准备动画+ (void)commitAnimations; // 运行动画// 没有get方法,下面的s ...一.基本方式:使用UIView类的UIViewAnimation扩展函数说明+ (void)beginAnimations:(NSString *)animationID context:(void *)context; // 开始准备动画+ (v 阅读全文
posted @ 2012-07-05 02:50 GreyWolf 阅读(233) 评论(0) 推荐(0)
摘要:PropertiesalwaysBounceHorizontal //一个布尔值,决定是否弹跳总是出现水平滚动时达到结束内容的看法。默认值是NO 。@property(nonatomic) BOOL alwaysBounceHorizontal //如果这个属性被设置为YES而且bounces的值是YES,水平拖动是允许的内容,即使小于滚动视图的边界。默认值是NOalwaysBounceVertical //一个布尔值,决定是否反弹总是发生在垂直滚动到达结束内容。默认值是NO 。@property(nonatomic) BOOL alwaysBounceVertical... 阅读全文
posted @ 2012-07-05 02:47 GreyWolf 阅读(209) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 下一页