Fork me on GitHub

2012年3月23日

摘要: - (CGSize)sizeThatFits:(CGSize)size; // return 'best' size to fit given size. does not actually resize view. Default is return existing view size- (void)sizeToFit; // calls sizeThatFits: with current view bounds and changes bounds size.sizeThatFits:Asks the view to calculate and return th... 阅读全文
posted @ 2012-03-23 17:30 pengyingh 阅读(21746) 评论(0) 推荐(1)
摘要: The iphone app im writing displays an html page, i would like to add a search feature where the user can search for instances for the keyword and highlight them (like in firefox using ctrl+F)what's the best way to do this? in objective-c? would this be even possible with javascript?Please point 阅读全文
posted @ 2012-03-23 15:08 pengyingh 阅读(932) 评论(0) 推荐(0)
摘要: 1.循环滚动每次滚动后都将scrollview的offset设置为中间的一页若本次滚动是向前一页滚动,则把三页都向后放置,最后一页放到开头若本次滚动是向后一页滚动,则把三页都向前放置,第一页放到末尾初始化UISCrollViewfloat x,y,width,height;x = WIDTH_OFF_SET;y = HEIGHT_OFF_SET;width = WIDTH_OFF_SET;height = SCROLLVIEW_HEIGHT;for (int j=0; j<3; j++) {UIView *view = [[UIView alloc] initWithFrame:CGRe 阅读全文
posted @ 2012-03-23 14:59 pengyingh 阅读(13611) 评论(1) 推荐(0)
摘要: 不用#if:NSString*deviceType =[UIDevice currentDevice].model;if([deviceType isEqualToString:@"iPhone"]){ //iPhone}elseif([deviceType isEqualToString:@"iPod touch"]){ //iPod Touch}else{ //iPad}使用#if:#ifdefUI_USER_INTERFACE_IDIOM //注意此处没有括号//UI_USER_INTERFACE_IDIOM 是枚举类型结构体,内有typedefe 阅读全文
posted @ 2012-03-23 11:18 pengyingh 阅读(1427) 评论(0) 推荐(0)

导航