摘要: 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 阅读(261) 评论(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 阅读(265) 评论(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 阅读(701) 评论(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 阅读(261) 评论(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 阅读(206) 评论(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 阅读(293) 评论(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 阅读(241) 评论(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 阅读(224) 评论(0) 推荐(0) 编辑
摘要: PropertiesalwaysBounceHorizontal //一个布尔值,决定是否弹跳总是出现水平滚动时达到结束内容的看法。默认值是NO 。@property(nonatomic) BOOL alwaysBounceHorizontal //如果这个属性被设置为YES而且bounces的值是YES,水平拖动是允许的内容,即使小于滚动视图的边界。默认值是NOalwaysBounceVertical //一个布尔值,决定是否反弹总是发生在垂直滚动到达结束内容。默认值是NO 。@property(nonatomic) BOOL alwaysBounceVertical... 阅读全文
posted @ 2012-07-05 02:47 GreyWolf 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 一、创建[java]view plaincopyprint?CGRectbounds=[[UIScreenmainScreen]applicationFrame];UIScrollView*scrollView=[[UIScrollViewalloc]initWithFrame:bounds];当你创建完滚动视图后,你可以将另一个视图的内容粘合到滚动视图的空白页上。这回创建一个滚动的内容窗口:[java]view plaincopyprint?[scrollViewaddSubview:myView];你必须给出内容的实际大小,这样滚动视图才知道滚动的范围:[java]view plainco 阅读全文
posted @ 2012-07-04 11:52 GreyWolf 阅读(207) 评论(0) 推荐(0) 编辑