I am new to iOS development.
I would like to know if in iOS 7 when sending a message under UINavigationBar
, which has a title called : Sending, there is a progress bar that is loading till the message is successfully sent.
My question is:
Is that bar a progress bar?
In iOS 6, the progress bar is inside the
UINavigationBar
?
Can someone give me some ideas about how to create this on iOS 7 and iOS6?
I haven't yet tried anything. I would like to read some tutorials or examples with this type of issue.
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];
Unfortunalty the progress bar is not under the navigationController. Why?