Fortschrittsbalken unter der Navigationsleiste hinzufügen
Ich bin neu in der iOS-Entwicklung.
Ich würde gerne wissen, ob in iOS 7 beim Versenden einer Nachricht unterUINavigationBar
Der Titel lautet: Senden. Es wird ein Fortschrittsbalken geladen, bis die Nachricht erfolgreich gesendet wurde.
Meine Frage ist:
Ist dieser Balken ein Fortschrittsbalken?
In iOS 6 befindet sich der Fortschrittsbalken imUINavigationBar
?
Kann mir jemand einige Ideen geben, wie man dies auf iOS 7 und iOS6 erstellt?
Ich habe noch nichts ausprobiert. Ich möchte einige Tutorials oder Beispiele zu dieser Art von Problemen lesen.
Hier ist mein 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];
Leider befindet sich der Fortschrittsbalken nicht unter dem navigationController. Warum?