資源描述:
《IOS iPhone開發(fā) UI整理總結》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在教育資源-天天文庫。
1、廣播//發(fā)送者//發(fā)送值改變的廣播(通知)[[NSNotificationCenterdefaultCenter]postNotificationName:@"dataChange"object:nil];//接受者//接收廣播[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(reloadView)name:@"dataChange"object:nil];-(void)dealloc{[[NSNotificationCenterdefaul
2、tCenter]removeObserver:selfname:@"dataChange"object:nil];[superdealloc];}push-popView[self.navigationControllerpushViewController:subanimated:YES];[self.navigationControllerpopViewControllerAnimated:YES];//顯示導航條[self.navigationControllersetNavigationBarHidden:NOanimate
3、d:YES];模態(tài)化彈出[self.navigationControllerpresentModalViewController:Controlleranimated:YES];[ControllerdismissViewControllerAnimated:YEScompletion:^{}];動畫[UIViewanimateWithDuration:0.1animations:^{//通過transform讓imageView轉(zhuǎn)動一周_refreshView.transform=CGAffineTransformRotate(_
4、refreshView.transform,1.0);}];heightForRowAtIndexPath-(CGFloat)tableView:(UITableView*)tableViewheightForRowAtIndexPath:(NSIndexPath*)indexPath{//根據(jù)數(shù)據(jù)源中的數(shù)據(jù),以及cell中各個控件的frame的設定,重新計算行高ChatModle*modle=[_dataArrayobjectAtIndex:indexPath.row];CGSizesize=[modle.chatTextsize
5、WithFont:[UIFontsystemFontOfSize:18]constrainedToSize:CGSizeMake(260,999)lineBreakMode:NSLineBreakByCharWrapping];returnsize.height+40;}UILabel字體加粗;[UILabelsetFont:[UIFontfontWithName:@"Helvetica-Bold"size:20]];加粗并且傾斜[UILabelsetFont:[UIFontfontWithName:@"Helvetica-Bold
6、Oblique"size:20]];UILabel使用自定義字體博客分類:Phone/IOS/Objective-C?xcode4?下載自定義字體(例如:Blazed.ttf)后,拖入項目當中。?在SupportingFiles中找到(項目名稱)-info.plist,添加Fontsprovidedbyapplication項,打開對應的數(shù)組,可以設置多個字體,在Item0中輸入Blazed.ttf。?在程序中通過字體familyname,找出字體名字。然后使用?C代碼?1.label.font?=?[UIFont?fontwith
7、name:@"Blazed"?size:42];????或者?C代碼?1.UIFont?*tfont?=?[UIFont?fontWithName:@"Blazed"?size:42];??2.label.font?=?tfont;????例外還有其他設置:?C代碼?1.UILabel?*label?=?[[UILabel?alloc]initWithFrame:CGRectMake(50.0,?20.0,?200.0,?50.0)];?????????C代碼?1.//設置陰影??2.[label?setShadowColor:[U
8、IColor?blackColor]];??3.[label?setShadowOffset:CGSizeMake(-2,?3)];??4.??5.??6.//設置是否能與用戶進行交互???????7.label.userIntera