欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

IOS對話框UIAlertView-創(chuàng)新互聯(lián)

為柯坪等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及柯坪網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站設(shè)計、成都網(wǎng)站制作、柯坪網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達到每一位用戶的要求,就會得到認可,從而選擇與我們長期合作。這樣,我們也可以走得更遠!> 1 //修改彈出對話框的樣式 2 alertView.alertViewStyle = UIAlertViewStylePlainTextInput; 3 4 //根據(jù)索引獲取指定的某個文本框 5 [alertView textFieldAtIndex :0] 6 [alertView textFieldAtIndex :0].text = her.name; 7 8 //通過UIAlertView的代理來監(jiān)聽對話框中的按鈕的點擊事件 9 //實現(xiàn)UIAlertView的10 -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 代理方法實例代碼:IOS對話框UIAlertVie
w
 1 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
 2     CZHero *hero = self.heros[indexPath.row];
 3     UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitels:@"確定",nil];
 4 
 5     alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
 6     [alertView textFieldAtIndex:0].text = hero.name;
 7 
 8   //記錄當(dāng)前點擊行的行號 9     alertView.tag = indexPath.row;
10     [alertView show]
11 }
12 
13 #pragma mark - alertView的代理方法
14 -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger) buttonIndex{
15   //判斷點擊的是哪個按鈕16   if(buttonIndex ==1){
17 //獲取文本框中的數(shù)據(jù)18         NSString *name = [alertView textFieldAtIndex:0].text;
19 
20 //修改模型數(shù)據(jù)
21 //根據(jù)行號,獲取當(dāng)前點擊行的模型數(shù)據(jù)22         CZHero *hero = self.heros[alertView.tag];
23         hero.name = name;
24 
25 //重新刷新TableView數(shù)據(jù)
26 //重新刷新整個TableView,UITableView會重新向 datasource請求數(shù)據(jù)
27 //重新調(diào)用數(shù)據(jù)源方法
28 //[self.tableView reloadData];//不好重新刷新整個TableView
29        
30 //局部刷新
31 //創(chuàng)建一個indexPath對象32         NSIndexPath *path = [NSIndexPath indexPathForRow:alertView.tag inSection:0];
33 
34         [self.tableView reloadRowsAtIndexPaths:@[path] withRowAnimation:UITableViewRowAnimationLeft];
35     }
36 }

標(biāo)題名稱:IOS對話框UIAlertView-創(chuàng)新互聯(lián)
文章出自:http://chinadenli.net/article36/piipg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供手機網(wǎng)站建設(shè)定制開發(fā)全網(wǎng)營銷推廣網(wǎng)站導(dǎo)航動態(tài)網(wǎng)站靜態(tài)網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)