ITeye博客

龙泉android,ios无线技术博客

修博龙泉 · 共 123 篇文章

NSTimer-动态修改Interval的值

NSTimer使用例子: NSTimer *showTimer = [nstimer scheduledtimerwithtimeinterval:1 target:self selector:@selector(hzlight:) userinfo:nil repeats:yes]; [showtimer fire]; 但是如果要不停的更改Interval值的时候,会出现很多NSTimer并发,如何修改一个timer来响应不同变化Interval值的需求。方法有两种:

2013-05-06 09:38 · ios开发学习相关 · 评论(0)

BNF巴科斯范式及其扩展

巴科斯范式及其扩展 BNF & Augmented BNF 什么是巴科斯范式 巴科斯范式(BNF: Backus-Naur Form 的缩写)是由 John Backus 和 Peter Naur 首次引入一种形式化符号来描述给定语言的语法(最早用于描述ALGOL 60 编程语言)。确切地说,早在UNESCO(联合国教科文组织)关于ALGOL 58的会议上提出的一篇报告中,Backus就引入了大部分BNF符号。虽然没有什么人读过这篇报告,但是在Peter Naur读这篇报告时,他发现Backus对ALGOL 58的解释方式和他的解释方式有一些不同之处,这使他感到很惊奇。首次设计ALGOL的所…

2013-05-02 09:50 · 评论(0)

初探Java8新特性之lambda表达式

Java8带有Lambda表达式的预览版的JDK已经放出来了(地址在最下面),新特性有以下四个: 1.Lambda表达式(或称之为“闭包”或者“匿名函数”) 2.扩展的目标类型 3.方法和构造器引用 4.接口默认方法 本文先介绍一下很值得期待的Lambda表达式,lambda表达式,等同于大多说动态语言中常见的闭包、匿名函数的概念。其实这个概念并不是多么新鲜的技术,在C语言中的概念类似于一个函数指针,这个指针可以作为一个参数传递到另外一个函数中。 由于Java是相对较为面向对象的语言,一个Java对象中可以包含属性和方法(函数),方法(函数)不能孤立于对象单独存在。这样就产生了一个问题,有时…

2013-05-02 09:46 · Test · 评论(0)

UIScrollView的属性总结

UIScrollView的属性总结 属性 作用 CGPoint contentOffSet 监控目前滚动的位置 CGSize contentSize 滚动范围的大小 UIEdgeInsets contentInset 视图在scrollView中的位置 id delegate 设置协议 BOOL directionalLockEnabled 指定控件是否只能在一个方向上滚动 BOOL bounces 控制控件遇到边框是否反弹 BOOL alwaysBounceVertical 控制垂直方向遇到边框是否反弹 BOOL alwaysBounceHorizontal 控制水平方向遇到边框是否反弹 …

2013-04-27 10:00 · ios开发学习相关 · 评论(0)

单例设置

+ (RootScrollView *)shareInstance; + (RootScrollView *)shareInstance { static RootScrollView *__singletion; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ __singletion=[[self alloc] initWithFrame:CGRectMake(0, 44, 320, [globle shareinstance].globleHeight-44)]; }); return __singletio…

2013-04-27 09:51 · ios开发学习相关 · 评论(0)

颜色设置

[globle colorfromhexrgb:@"bb0b15"] + (UIColor *)colorFromHexRGB:(NSString *)inColorString { UIColor *result = nil; unsigned int colorCode = 0; unsigned char redByte, greenByte, blueByte; if (nil != inColorString) { NSScanner *scanner = [nsscanner scannerwithstring:incolorstring]; (void) [scanner sc…

2013-04-27 09:50 · ios开发学习相关 · 评论(0)

翻转动画

CGContextRef context = UIGraphicsGetCurrentContext(); [uiview beginanimations:nil context:context]; [uiview setanimationtransition:uiviewanimationtransitionflipfromleft forview:self.navigationcontroller.view cache:no]; [uiview setanimationcurve:uiviewanimationcurveeaseinout]; [uiview setanimationdu…

2013-04-11 16:11 · ios开发学习相关 · 评论(0)

计算字符串高度

- (float)countHeightOfString:(NSString *)string WithWidth:(float)width Font:(UIFont *)font { if ([nsnull null] == (id)string) { string = @"暂时没有数据"; } CGSize constraintSize = CGSizeMake(width,500);//MAXFLOAT CGSize labelSize = [string sizewithfont:font constrainedtosize:constraintsize linebreakmode:…

2013-04-10 11:39 · ios开发学习相关 · 评论(0)

uiimageview图片截取

/** *从图片中按指定的位置大小截取图片的一部分 * UIImage image 原始的图片 * CGRect rect 要截取的区域 */ - (UIImage *)imageFromImage:(UIImage *)image inRect:(CGRect)rect { CGImageRef sourceImageRef = [image cgimage]; CGImageRef newImageRef = CGImageCreateWithImageInRect(sourceImageRef, rect); UIImage *newImage = [uiimage imagewith…

2013-04-09 12:00 · ios开发学习相关 · 评论(0)

imageView添加阴影和边框

// //给imageView添加阴影和边框 // UIImageView*imgvPhoto = [[uiimageview alloc] init]; //添加边框 CALayer *layer = [imageview layer]; layer.borderColor = [uicolor whitecolor].CGColor; layer.borderWidth = 5.0f; //添加四个边阴影 imageView.layer.shadowColor = [uicolor blackcolor].CGColor; imageView.layer.shadowOffset = C…

2013-04-09 11:57 · ios开发学习相关 · 评论(0)

视觉还原

- (void) viewDidAppear:(BOOL)animated{ UIView *view=(UIView *)[[appdelegate appdelegate].window viewWithTag:800]; [view removefromsuperview]; UIImageView *bgImage = [[uiimageview alloc]initWithFrame:CGRectMake(0, 0,320,480)]; bgImage.tag = 800; [bgimage setimage:[uiimage imagenamed:@"testsubject.pn…

2013-04-02 15:25 · ios开发学习相关 · 评论(0)

fenye

#import "WTAlbumImVC.h" #import "WTPullRefreshView.h" #import "WTAlbumPicListCell.h" #import "WTPictureDetailVC.h" @interface WTAlbumImVC () <WTPullRefreshViewDelegate, WTPictureDetailVCDelegate> // picture list view @property (retain, nonatomic) IBOutlet UIView *picListView; @property (retain, non…

2013-01-06 20:25 · ios开发学习相关 · 评论(0)

字符串为空判断

NSString *trimedString = ]; if ( == 0) { UIAlertView *alert = initWithTitle:@"警告" message:@"搜索内容不能为空" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; ; ; return true; }

2013-01-04 14:47 · ios开发学习相关 · 评论(0)

ios:升级到Xcode4.5.1的警告处理

Xcode升级到4.5后,出现了一堆的Warning.网上搜了一些办法,总结一下。 #if __has_feature(objc_arc) && clang_major >= 3 #define PP_ARC_ENABLED 1 #endif // __has_feature(objc_arc) #if PP_ARC_ENABLED #define PP_RETAIN(xx) (xx) #define PP_RELEASE(xx) xx = nil #define PP_AUTORELEASE(xx) (xx) #else #define PP_RETAIN(xx) #define PP_R…

2012-12-18 10:40 · ios开发学习相关 · 评论(0)

ios 动画

//开启动画效果代码 [uiview animatewithduration:2 animations:^{ //动画 } completion:^(bool finish){ //最后位置 self.searchtext.frame = CGRectMake (0,100,200,31); }]; //长按闪动效果 [uiview animatewithduration:0.3 delay:0 options:uiviewanimationoptionallowuserinteraction animations:^{ cell.contentview.backgroundcolor = …

2012-12-14 13:36 · ios开发学习相关 · 评论(0)