網路等待indicator的介面設定

2021-08-26 19:45:39 字數 1492 閱讀 8387

uiwebview載入loading...兩種方法

第一種方法:使用uiview and uiactivityindicatorview

//建立uiwebview

webview = [[uiwebview alloc] initwithframe:cgrectmake(0, 44, 320, 400)];

[webview setuserinteractionenabled:no];

[webview setbackgroundcolor:[uicolor clearcolor]];

[webview setdelegate:self];

[webview setopaque:no];//使網頁透明

nsstring *path = @"";

nsurl *url = [nsurl urlwithstring:path];

[webview loadrequest:[nsurlrequest requestwithurl:url]];

//建立uiactivityindicatorview背底半透明view

uiview *view = [[uiview alloc] initwithframe:cgrectmake(0, 0, 320, 480)];

[view settag:103];

[view setbackgroundcolor:[uicolor blackcolor]];

[view setalpha:0.8];

[self.view addsubview:view];

activityindicator = [[uiactivityindicatorview alloc] initwithframe:cgrectmake(0.0f, 0.0f, 32.0f, 32.0f)];

[activityindicator setcenter:view.center];

[activityindicator setactivityindicatorviewstyle:uiactivityindicatorviewstylewhite];

[view addsubview:activityindicator];

[self.view addsubview:webview];

[view release];

[webview release];

//開始載入資料

- (void)webviewdidstartload:(uiwebview *)webview

//資料載入完

- (void)webviewdidfinishload:(uiwebview *)webview

第二種方法:使用uialertview and uiactivityindicatorview

//載入網頁動畫

- (void)webviewdidstartload:(uiwebview *)webview

}- (void)webviewdidfinishload:(uiwebview *)webview

網路等待indicator的介面設定

uiwebview載入loading.兩種方法 第一種方法 使用uiview and uiactivityindicatorview 建立uiwebview webview uiwebview alloc initwithframe cgrectmake 0,44,320,400 webview s...

iOS網路等待實現方法

uiwebview載入loading.兩種方法 第一種方法 使用uiview and uiactivityindicatorview 建立uiwebview webview uiwebview alloc initwithframe cgrectmake 0,44,320,400 webview s...

Linux ifconfig命令 配置網路介面

ifconfig 命令最主要的作用就是檢視 ip 位址的資訊,直接輸入ifconfig命令即可。root localhost ifconfig eth0 link encap ethernet hwaddr 00 oc 29 c5 fb aa eth0網絡卡資訊 網路型別為乙太網 mac位址 ine...