国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > iOS > 正文

IOS開發(fā)日記

2019-11-09 15:10:34
字體:
供稿:網(wǎng)友

2016.07.19

UILabel 在寬度固定的情況下,設(shè)置其根據(jù)文字長度調(diào)整字體:@PRoperty (weak, nonatomic) IBOutlet UILabel *pinyName;self.pinyName.adjustsFontSizeToFitWidth = YES;彈出框

IOS 9.0 以前:

NSString *msg = @"something";UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:msg delegate:self cancelButtonTitle:@"確定" otherButtonTitles:nil, nil];[alert show];

IOS 9.0 以后:

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"something" preferredStyle:UIAlertControllerStyleAlert];[alertController addAction:[UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { // 響應(yīng)事件}]];[self presentViewController:alertController animated:YES completion:nil];

2016.07.20

根據(jù)內(nèi)容調(diào)整UIView大小UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"psnChangeCell"];UILabel *textView = (UILabel *)[cell viewWithTag:17];textView.text = rowRecord.msg;CGSize s = [textView sizeThatFits:CGSizeMake([UIScreen mainScreen].bounds.size.width - 74, FLT_MAX)];從 storyboard 中加載 view controller 并顯示let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)let registerViewController = mainStoryboard.instantiateViewControllerWithIdentifier("registerViewController")self.presentViewController(registerViewController, animated: false, completion: nil)使 UITextField 彈出的鍵盤為數(shù)字鍵盤self.resultTextField.keyboardType = .NumberPad

2016.07.22

禁止 UITableViewCell 向左滑動時顯示刪除按鈕- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleNone;}

2016.07.26

自定義導(dǎo)航欄的標(biāo)題// 設(shè)置自定義標(biāo)題欄,避免標(biāo)題過長,返回按鈕被遮蓋的問題UIView *titleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 40)];UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];[titleLabel setFont:[UIFont systemFontOfSize:17.0 weight:UIFontWeightMedium]];[titleLabel setTextColor:[UIColor whiteColor]];[titleLabel setCenter:titleView.center];[titleLabel setTextAlignment:NSTextAlignmentCenter];[titleLabel setAdjustsFontSizeToFitWidth:YES];[titleView addSubview:titleLabel];[self.navigationItem setTitleView:titleView];[titleLabel setText:self.title];self.titleLabel = titleLabel;去除UITableView底部多余的分割線- (void)viewDidLoad{ [super viewDidLoad]; self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];}

2016.07.29

Observer模式應(yīng)用// 添加Observer[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadFCL) name:@"reloadFCL" object:nil];// 刪除Observer- (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self];}// 發(fā)送消息,userInfo是一個Dictionary[[NSNotificationCenter defaultCenter] postNotificationName:@"reloadFCL" object:nil userInfo:nil];屏蔽手勢滑動返回功能- (void)viewWillAppear:(BOOL)animated{ // 屏蔽手勢返回功能 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = NO; }}- (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:YES]; // 開啟手勢返回功能 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = YES; }}

2016.08.02

設(shè)置UILabel當(dāng)text過長時以省略號結(jié)尾[titleLabel setLineBreakMode:NSLineBreakByTruncatingTail];

2016.08.03

隱藏導(dǎo)航欄[self.navigationController setNavigationBarHidden:YES];

2016.08.04

隱藏UIViewController底部導(dǎo)航欄[controller setHidesBottomBarWhenPushed:YES];[self.navigationController pushViewController:controller animated:YES];

2016.08.24

隱藏系統(tǒng)狀態(tài)欄,頂部帶電池的那個欄- (BOOL)prefersstatusBarHidden { return YES;}顯示等待窗口// 定義 indicatorView 和 indicatorLabel@property (strong, nonatomic) UIActivityIndicatorView* indicatorView;@property (strong, nonatomic) UILabel* indicatorLabel;// 初始化self.indicatorView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];self.indicatorView.center = self.view.center;self.indicatorView.frame = self.view.frame;self.indicatorView.backgroundColor = [UIColor blackColor];self.indicatorView.alpha = 0.75;self.indicatorView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;[self.view addSubview:self.indicatorView];self.indicatorLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 250, 30)];self.indicatorLabel.textColor = [UIColor whiteColor];self.indicatorLabel.textAlignment = NSTextAlignmentCenter;self.indicatorLabel.text = @"正在加載會議列表,請稍候...";self.indicatorLabel.center = CGPointMake(self.view.center.x, self.view.center.y + 40);[self.view addSubview:self.indicatorLabel];// 顯示&隱藏[self.indicatorView startAnimating];self.indicatorLabel.hidden = NO;

2016.09.08

URL打開app 首先被啟動的應(yīng)用需要向iphone注冊一個自定義URL協(xié)議。這是在你的項目文件夾的info.plist文件進(jìn)行的(就是你改變應(yīng)用程序圖標(biāo)的同一個文件)。右鍵,選擇“Add Row”Key值選擇“URL types”打開“Item 0″,然后為該key增加一個URL identifier。可以是任何值,但建議用“反域名”(例如 “com.cynhard.LinphoneTest”)。在“Item 0”下再加一行。選擇“URL Schemes” 作為Key。輸入你的URL協(xié)議名 (例如“testHello://” 應(yīng)寫做“testHello”)。如果有必要,你可以在這里加入多個協(xié)議。訪問URL:<!DOCTYPE html><html> <head> <title>Hello World</title> </head> <body> <a href="LinphoneTest://">test</a> </body></html>

2016.09.09

使用lipo命令合成靜態(tài)庫lipo -create Release-iphoneos/libMyToolsA.a Release-iphonesimulator/libMyToolsA.a -output libMyToolsA.a查看庫的信息lipo -info libMyToolsA.a
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿克苏市| 化州市| 肥乡县| 马公市| 平罗县| 林周县| 长春市| 多伦县| 田东县| 榕江县| 利津县| 克东县| 北海市| 昌图县| 博爱县| 高台县| 北安市| 汝阳县| 松滋市| 揭阳市| 五家渠市| 繁昌县| 许昌县| 奉新县| 会昌县| 云阳县| 汨罗市| 青州市| 南安市| 洛川县| 丰宁| 梨树县| 托克逊县| 时尚| 奉贤区| 舒兰市| 皋兰县| 泸西县| 怀柔区| 天水市| 德令哈市|