/// Show the custom statusbar // -( Void ) Btn1 :( ID ) Sender { If (Self. Win & self. Win. Frame. Origin. Y = 0 ) Return ; If (Self. Win = Nil) {self. Win = [[Uiwindow alloc] initwithframe: cgrectmake (0 ,- 20 , 320 , 20 )]; Self. Win. windowlevel = Uiwindowlevelalert; self. Win. backgroundcolor = [Uicolor redcolor];} [self. Win makekeyandvisible]; // Show it with animation [Uiview beginanimations: Nil context: Nil]; [uiview setanimationduration :. 3 ]; Self. Win. Frame = Cgrectmake ( 0 , 0 , 320 , 20 ); [Uiview commitanimations];} /// Hide it: // -( Void ) Btn2 :( ID ) Sender { If (Self. Win = nil | (self. Win & self. Win. Frame. Origin. Y =- 20 )) Return ; [Uiugetmainwindow () makekeyandvisible]; // Mainwindow: [[[uiapplication sharedapplication] windows] objectatindex: 0]. [Uiview beginanimations: Nil context: Nil]; [uiview setanimationduration :. 3 ]; Self. Win. Frame = Cgrectmake ( 0 ,- 20 , 320 , 20 ); [Uiview commitanimations];}