creating new view in iPhone application - iphone

i just finished my first view in my iPhone app and i want to add a second view to wich the user go when he click in the button in the first view. So i add new view from the librairy window, but i don't see the battery in the top, is that normal ? and how to add it please ??

Assuming you mean the status bar along the top you can try this code to make sure it is shown:
[[UIApplication sharedApplication] setStatusBarHidden:NO];
or:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
if you want to animate it coming down.
Cheers.

Related

iOS - On ipad standby my application gets stuck

I am using the following code to disable and enable View.
TO DISABLE VIEW.
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];
_loadingSpinner.hidden = FALSE;
TO ENABLE VIEW.
[[UIApplication sharedApplication] endIgnoringInteractionEvents];
_loadingSpinner.hidden = true;
but when device goes into standby mode. application freezes. Users have close the application in the task pane in order to run it again.
Please HELP!!!!
Why are you disabling the view? If you are wanting to prevent interaction while a process completes, why not use something like MBProgressHUD or make your own Modal view and use that?
Put a breakpoint and check weather the code to end the interaction is hit at any time.
Why dont you use a overlay view with the spinner or userInteractionEnabled Property of UIView for the purpose?

Navigation bar is not shown properly when get back from Movie Player in iphone SDK

In my app, I load a HTML Page in Web View which contains a video. Till this the navigation bar is shown properly.
But when i play video with by default Movie Player in iphone & try to see it in Both Landscape/Portrait mode with Full Screen. When get Back from Movie Player, the Navigation Bar is go to upside & status Bar is Cover some view.
I am not taken mediaPlayer framework or any other class in my project.
How can i solved This issue??
Just paste this below line in to the viewWillAppear: on that view controller class where this issue occurs.
Objective C
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Swift
UIApplication.shared.setStatusBarHidden(false, with:UIStatusBarAnimation.none)
In your Movie player class replace
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
with
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Means if you hide your status bar when came back from player then the height of the view will increased by 20 pixels.
So your view will go upside

How to show status bar initially hidden from plist iphone

i want to hide the status bar when i launch my app to view launch image that was covered by status bar. so in plist i added
Status bar is initially hidden YES
and status bar is covered.
My problem is that status bar is covered always in my app, i want to hide status bar only for launch image, what can i do?
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
SOLVED
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:NO];
using this at launch of app :)
you can do this by adding property, "Status bar Initially Hidden" to plist as shown below : -
OR
you can also set the (Status bar Initially Hidden)Property to "NO" in Info.plist file in your Application.
Just uncheck this property.
Neither Niko's nor JackTurky's solutions are correct. Niko's:
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
...works but is deprecated. Correct in iOS 3.2 and later is:
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];

Iphone programming: remove bar

I'm not sure what it is called, but there is a bar at the top of the iphone screen with the time and battery. What is the simplest way to remove it?
In your Info.plist file, set UIStatusBarHidden to true. Also, you might have to add this in your app delegate:
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
As a reminder, you might have to change the height in your NIB file since the bar is hidden. It might not change it automatically.
Go to your applicationDidFinishLaunching: in you app delegate and write this code..
[[UIApplication sharedApplication] setStatusBarHidden:YES];

Write some text in (or on) UIStatusBar

I know, it's a strange question ^^,
I would like to know if there is a way to write some text in (or on) the UIStatusBar. In particular I want to write some text on the Status Bar when the user press a UIButton.
Thanks!
I'm not sure if you can draw directly into the status bar, but you should be able to draw on top of it in a custom view. You can get the status bar's frame using:
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
And you can get the application's main window (presumably the status bar's superview) using:
UIWindow *mainWindow = [[UIApplication sharedApplication] keyWindow];
You should be able to add your custom view directly to the key window in the status bar's frame. For an example of an app that appears to "modify" the status bar, take a look at Reeder.
No, the status bar is a system-controlled element. It's content cannot be modified by a third-party application.
Check out this work in progress: https://github.com/maciekish/APStatusBarExtensions
MTStatusBarOverlay is what you want :
https://github.com/myell0w/MTStatusBarOverlay
Definitely the easier to use !