摘要: Object-c中比较两个字符串是否相等时,应该用isEqualToString:而不能仅仅只是比较字符串的指针值。NSString *str1=@"hello 1"; NSString *str2; str2=[NSString stringWithFormat:@"hello %d", 1]; if ([thing1 isEqualToString:thing2]){ NSLog(@"They are the same!") } 这是比较内容if (str1==str2){ NSLog(@"They are the sa 阅读全文
posted @ 2013-07-11 11:31 子福当自强 阅读(697) 评论(0) 推荐(0) 编辑
摘要: 后面加-Bold就是加粗 加-Oblique就是倾斜等还有不懂请看http://iosfonts.com/iPhone 5.0iPad 5.0Font Families:58Font Families:58Academy Engraved LETAcademyEngravedLetPlainAcademyEngravedLetPlainAmerican TypewriterAmericanTypewriter-CondensedLightAmericanTypewriter-CondensedLightAmericanTypewriter-LightAmericanTypewriter-Lig 阅读全文
posted @ 2013-07-11 10:53 子福当自强 阅读(1613) 评论(0) 推荐(0) 编辑
摘要: frame:指的是视图在父视图的坐标系统中的大小和位置。bound:指的是视图在试图本身的坐标系统中的大小(位置起点是原点)。center:指的是视图在父视图坐标系统中的中心点。贴张苹果官网的图:frame和bound的关系下面这是其中一个发生变化,其余两个的变化,直接看吧,很浅显。Although you can change theframe,bounds, andcenterproperties independent of the others, changes to one property affect the others in the following ways:When y 阅读全文
posted @ 2013-07-11 10:37 子福当自强 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 1、UISearchBar自定义背景、取消按钮中文设置C代码UISearchBar*seachBar=[[UISearchBaralloc]init];//修改搜索框背景seachBar.backgroundColor=[UIColorclearColor];//去掉搜索框背景[[searchbar.subviewsobjectAtIndex:0]removeFromSuperview];for(UIView*subviewinseachBar.subviews){if([subviewisKindOfClass:NSClassFromString(@"UISearchBarBack 阅读全文
posted @ 2013-07-11 10:12 子福当自强 阅读(424) 评论(0) 推荐(0) 编辑
摘要: 1、UIImageview设边框、圆角需要引QuartzCore/QuartzCore.h>C代码//设UIImageView边框CALayer*layer=[m_imgViewlayer];[layersetMasksToBounds:YES];layer.cornerRadius=10.0;//设圆角[layersetBorderWidth:1];[layersetBorderColor:[[UIColorblackColor]CGColor]];2、bounds属性和frame属性区别 frame指的是:该view在父view坐标系统中的位置和大小. bounds指的是:该view 阅读全文
posted @ 2013-07-11 10:11 子福当自强 阅读(326) 评论(0) 推荐(0) 编辑
摘要: iphone中常用的消息提示控件,就是UIActionSheet和UIAlertView了,在Web开发中,UIActionSheet就像是confirm(),而UIAlertView就像是alert()一样UIActionSheetUIAlertView但在iphone中,这两个控件的功能可以自定义定义两个控件事件方法[cpp]view plaincopy#import@interfaceViewController:UIViewController-(IBAction)showActionSheet:(id)sender;-(IBAction)showAlertView:(id)sende 阅读全文
posted @ 2013-07-11 10:08 子福当自强 阅读(275) 评论(0) 推荐(0) 编辑
摘要: header通过下面两个代理方法设置- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)sectionfooter通过下面两个- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section- (U 阅读全文
posted @ 2013-07-11 10:05 子福当自强 阅读(11228) 评论(0) 推荐(0) 编辑
悟道