uiactivityindicatorview

Using UIActivityIndicatorView with UIWebView in Swift

无人久伴 提交于 2019-12-03 11:49:24
I'm trying to display an Activity Indicator View in my app to users while a url is being loaded into a WebView. I've tried toying with activity.startAnimating/activity.stopAnimating and tried placing them in functions, etc. but have not had any luck. The best I have been able to get is the Activity Indicator to appear and animate, but then not stop animating or hide once my url is loaded, so it continues spinning on top of the web page. In other situations, when trying to move around activity.startAnimating, I have encountered the "Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode

Displaying activity indicator on WKWebView using swift

房东的猫 提交于 2019-12-03 09:40:36
I am working on the following code and trying to show an activity indicator in the view whilst the page is loading.. I tried to implement the WKNavigationDelegate methods but I am failing as nothing shows. Any suggestions on how to fix this? I am not setting the SupportWebView view delegate anywhere but I wouldn't know how to do it in swift.. import UIKit import WebKit class SupportWebView: UIViewController, WKNavigationDelegate { @IBOutlet var containerView : UIView? = nil var webView: WKWebView? override func loadView() { super.loadView() self.webView = WKWebView() self.view = self.webView }

UIWebView show UIActivityIndicator for loading but ignore additional load requests (e.g. javascript loaded advertisements) after page initially loads

帅比萌擦擦* 提交于 2019-12-03 08:43:57
This is a Q&A post. To inform the many other users I saw who struggled with this issue as I browsed through StackOverflow's database. None of these users ever got a solid answer (and most of them were posing the question years ago so I wasn't going to bump the post). The issue many struggled with is as follows: When you try to load a page in a UIWebView and the page then loads another page maybe via an iFrame or it loads an advertisement through javascript you end up getting the page loading function called again and if you are using a UIActivityIndicator it will get called again as well and

Add UIActivityIndicatorView into UIBarButton

北城余情 提交于 2019-12-03 04:46:13
问题 How do I add a UIActivityIndicatorView spinner circle into a UIBarButton, so that when a user taps on one of those buttons on the navigation bar, they see a spinner while the loading takes place? 回答1: If you're trying to show the activity wheel in a navigation bar button (e.g. you might have a refresh button on your navbar) - you can create a new UIBarButtonItem with a custom view being the UIActivityIndicatorView : Objective-C uiBusy = [[UIActivityIndicatorView alloc]

Adding Activity Indicator to UIAlertView

廉价感情. 提交于 2019-12-03 03:02:37
I'm trying to add UIActivityIndicatorView to UIAlertView but couldn't get it done. I have seen posts on this implementation and found out that it works only for versions below iOS7. Below is the code I've tried... var alert: UIAlertView = UIAlertView(title: "Title", message: "Please wait...", delegate: nil, cancelButtonTitle: "Cancel"); var loadingIndicator: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(0.0, 0.0, 10.0, 10.0)) as UIActivityIndicatorView loadingIndicator.center = self.view.center; loadingIndicator.hidesWhenStopped = true loadingIndicator

Show activity indicator in SDWebImage

对着背影说爱祢 提交于 2019-12-03 02:54:17
问题 I'm using SDWebView image and i want to show an Activity Indicator as placeholder, while fetching the image from remote. I tried Malek's answer here How to show an activity indicator in SDWebImage, but it seems that UIImage *cachedImage = [manager imageWithURL:url]; is deprecated. Is there anyone using this library that could tell me how can i insert an Activity Indicator while loading the image? EDIT Following the indications of Michael Frederick, i ended up with this code and everything's

How to show activity indicator while tableView loads?

馋奶兔 提交于 2019-12-03 02:42:03
问题 When I switch between my tabs it loads some seconds and I want to know that my data is loading. For that I decided to add an activity indicator. I wrote a little function: func showActivityIndicator() { dispatch_async(dispatch_get_main_queue()) { self.spinner = UIActivityIndicatorView(activityIndicatorStyle: .WhiteLarge) self.spinner.frame = CGRect(x: 0.0, y: 0.0, width: 80.0, height: 80.0) self.spinner.center = CGPoint(x:self.loadingView.bounds.size.width / 2, y:self.loadingView.bounds.size

UIActivityIndicatorView or similar

北城以北 提交于 2019-12-03 02:27:40
问题 (source: tumblr.com) Can anyone tell me how to achieve such loading message? is it some variation of UIActivityIndicatorView? thanks peter 回答1: Something similar to the following in your initWithFrame of your custom subclassed UIView: _hudView = [[UIView alloc] initWithFrame:CGRectMake(75, 155, 170, 170)]; _hudView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]; _hudView.clipsToBounds = YES; _hudView.layer.cornerRadius = 10.0; _activityIndicatorView = [

Activity indicator with custom image

独自空忆成欢 提交于 2019-12-02 19:35:51
I am loading a UIWebView and in the meantime I wan't to show a blank page with this activity indicator spinning (siri activity indicator). From what I have understand you can not change the image, but can't I use that image and create an animation with it rotating 360° and looping? Or will that drain the battery? something like this?: - (void)webViewDidStartLoad:(UIWebView *)webView { //set up animation [self.view addSubview:self.loadingImage]; //start animation } - (void)webViewDidFinishLoad:(UIWebView *)webView { //stop animation [self.loadingImage removeFromSuperview]; } What should I do?

Add UIActivityIndicatorView into UIBarButton

早过忘川 提交于 2019-12-02 17:57:54
How do I add a UIActivityIndicatorView spinner circle into a UIBarButton, so that when a user taps on one of those buttons on the navigation bar, they see a spinner while the loading takes place? ferdil If you're trying to show the activity wheel in a navigation bar button (e.g. you might have a refresh button on your navbar) - you can create a new UIBarButtonItem with a custom view being the UIActivityIndicatorView : Objective-C uiBusy = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; uiBusy.hidesWhenStopped = YES; [uiBusy startAnimating];