I am new to iOS development.
I would like to know if, in iOS 7, when sending a message to the UINavigationBar , which has a header called: Sending, there is a progress bar that loads until the message is sent successfully.
My question is:
Can someone give me some ideas on how to create this on iOS 7 and iOS6?
I have not tried anything yet. I would like to read some tutorials or examples with this type of problem.
Here is my code:
int progress = 50;
CGRect navframe = [[self.navigationController navigationBar] frame]; int height= navframe.size.height; sendView = [[UIView alloc] init]; sendView.frame = CGRectMake(0, 0, 200, 30); sendView.backgroundColor = [UIColor clearColor]; UILabel* lbl = [[UILabel alloc] init]; lbl.frame = CGRectMake(0,0, 200, 15); lbl.backgroundColor = [UIColor clearColor]; lbl.textColor = [UIColor whiteColor]; lbl.shadowColor = [UIColor colorWithWhite:0 alpha:0.3]; lbl.shadowOffset = CGSizeMake(0, -1); lbl.font = [UIFont boldSystemFontOfSize:12]; lbl.text = @""; lbl.textAlignment = UITextAlignmentCenter; [sendView addSubview:lbl]; UIProgressView* pv = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar]; pv.frame = CGRectMake(0, 30-pv.frame.size.height, 200, pv.frame.size.height); pv.progress = progress/100.0; [sendView addSubview:pv]; [self.navigationController.navigationBar addSubview:sendView];
Unfortunately, the progress bar is not under the navigation controller. Why?
ios uinavigationbar uiprogressview
just ME
source share