uiprogressbar

Disabled touch when UIProgressBarHUD is shown

我只是一个虾纸丫 提交于 2019-12-25 01:54:30
问题 I've created an app where I'm creating a UIProgressBarHUD to show that something is loading. My question is, how can I disable the view so nothing can be pressed untill the loading is finished? I've tried setting: [self.view setUserInterationEnabled:NO]; However this doesn't work :/ Here is the code I'm using for adding the UIProgressHUD: - (IBAction) showHUD:(id)sender { //[self.view setUserInteractionEnabled:NO]; UIProgressHUD *HUD = [[UIProgressHUD alloc] initWithWindow:[[UIApplication

Swift - UIProgressView fills diagonally

霸气de小男生 提交于 2019-12-24 05:38:00
问题 So I set up a UIProgressView to fill after 3 seconds as well as increasing the height of the bar a bit. However when it fills up, it fills diagonally as opposed to just filling from one side to the other. The bar starts in the top right corner and then expands to fill the progress view just before it ends. This is the code I am using: import UIKit class LoadingScreen: UIViewController { @IBOutlet weak var progressView: UIProgressView! override func viewDidLoad() { super.viewDidLoad() UIView

updating UIProgressBar progress during loop

半腔热情 提交于 2019-12-12 04:06:15
问题 I can't find a clear answer on how to update the progress of a UIProgressbar whilst iterating a loop e.g. : for (int i=0;i<items.count;i++) { Object *new = [Object new]; new.xxx = @""; new... ... float progress = (i+1) / (float)items.count; progressBar.progress = progress; } [self save]; how can I update the UI on a seperate thread? 回答1: Run the loop on a background thread, and update the progress bar on the main thread: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY