3
我可以成功地推動我的iPhone應用程序只有下一個視圖。但是,導致下一個視圖檢索數據以填充UITableViews
,有時等待時間可能會持續幾秒或稍長一些,具體取決於連接。活動時推動下一個視圖指標 - didSelectRowAtIndexPath
在此期間,用戶可能會認爲應用程序已凍結等。因此,爲了解決此問題,我認爲實施UIActivityIndicators
是讓用戶知道該應用程序正在工作的好方法。
有人可以告訴我在哪裏可以實現嗎?
謝謝。
pushDetailView方法
- (void)pushDetailView {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
//load the clicked cell.
DetailsImageCell *cell = (DetailsImageCell *)[tableView cellForRowAtIndexPath:indexPath];
//init the controller.
AlertsDetailsView *controller = nil;
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
controller = [[AlertsDetailsView alloc] initWithNibName:@"DetailsView_iPad" bundle:nil];
} else {
controller = [[AlertsDetailsView alloc] initWithNibName:@"DetailsView" bundle:nil];
}
//set the ID and call JSON in the controller.
[controller setID:[cell getID]];
//show the view.
[self.navigationController pushViewController:controller animated:YES];
+1:好方法 – Jhaliya 2011-06-14 11:13:32
@Simon:酷,我會試試。有一個問題,我曾經有過幾次這樣做,但是有幾次,活動指示器顯示了視圖被推動時的情況。上面的這個方法是否會在用戶點擊單元格時顯示活動指示符?謝謝。 – 2011-06-14 11:16:24
K.Honda,查看我的更新回答 – EmptyStack 2011-06-14 11:45:16