ios - Adding a text and progress icon to navigation bar -
i add status navigation bar. example, in whatsapp, when user changes alert settings, display "updating" text , progress icon on navigation bar, shown in below image. how do that?
simple add separate view in xib, image below
and create iboutlet of components, , can below
self.navigationitem.titleview=self.progressview; //progressview iboutlet of container view progressview
in viewdidload
then can create function like
-(void)showprogress{ self.lblupdate.text=@"updating..."; [self.indicator startanimating]; } -(void)hideprogress{ self.lblupdate.text=@"updated"; [self.indicator stopanimating]; }
make sure make view background color clearcolor
, , make indicator hidewhenstopped
.
hope helps.
Comments
Post a Comment