Double status bar problems with the view - uibutton

i'm about to finish my app and right now i'm doing a bit of design. I've been watchind the iOS human interface Guidelines and one pint is: "Make sure your UI can handle the double-high status bar". Most of the app runs well with double status bar, but 2 things are not working well:
A label, when there's the double status bar disappears from the screen. Is there any way to relocate the label when there's the double status bar?
A button: It's a button with an image, it does not disappear but it appears with wrong proportions (to put an example: original measures: 44x44; with the double status bar: 44x20). Is there any way to solve it?
The rest of the app, which is based in a Navigation Controller works well with the double status bar.
Thanks.

You can set the frame of the UILabel and UIButton when the methods application:willChangeStatusBarFrame: and application:didChangeStatusBarFrame: get called.
Or if you're using Autolayout you may be able to set it up to let the UIView's (an UILabel and an UIButton in this case) move and resize correctly without any additional code.

Related

iOS 8 UISearchController's search bar is shifting down, If I click search bar

iOS8 Swift UISearchController hides navigationbar
I am facing same problem as in above link. So I have added following line.
self.searchController.hidesNavigationBarDuringPresentation = NO;
But now UISearchController's search bar is shifting down and some blank space is created on search bar's place. If I click cancel button, then search bar is restored to original position.
please help me to fix this issue in iOS 8 using objective-C.
For some reason (I believe this is a bug), UISearchController can place the search bar incorrectly on presentation if its frame coordinates are something other than (0,0).
To work around this, create a UIView where you want the UISearchBar to be and add the UISearchBar as a subview.
You might also be running into this bug: http://openradar.appspot.com/20942583

How animate the title / buttons in the UINavigationBar

I have in the UINavigationBar status information about the health of the app. It change the title text color, and one of the buttons there.
The changes work fine, but I wish to provide a smooth animation (because the status update on data changes) but don't know how. I'm not asking about moving to another views, but about how animate only the UINavigationBar titles & buttons.
I don't think you can animate those things without some extra work.
A navigation bar is a complex beast, and by default the UI objects that appear on the screen are private and maintained by the navigation bar or the current navigation item.
There should be a way to make it work however.
The current navigation item has a property titleView. normally it's nil and the navigation bar displays a title string itself. But if you plug a UILabel into the titleView property then you should be able to do animations on the animatable properties of the titleLabel.
Likewise with the bar button items.

How to make the status bar translucent in iOS 7?

In my app, I have some webviews. A transparent status bar doesn't look good for full screen webview. I want to make the status bar TRANSLUCENT, just like the game center.
I notice that the status bar would be drawn translucent if there is a navigation bar under it. But I want a translucent status bar BY ITSELF.
Is there any way to do this?
If you look at the Human Interface Guidelines section about the Status Bar it recommends (emphasis mine on the section most related to your question):
Prevent scrolling content from showing through the status bar. As
users scroll, you don’t want them to see a confusing mix of app
content and status bar items in the status bar area. To give users the
impression of spaciousness while still ensuring maximum readability,
make sure the status bar has a background that obscures the content
behind it. Here are a few ways to keep scrolling content from showing
through the status bar:
Use a navigation controller to display content. A navigation controller automatically displays a status bar background and it ensures that its content views don’t appear behind the status bar. (To learn more about navigation controllers, see “Navigation
Controllers”.)
Create a nondistracting custom image—such as a gradient—and display it behind the status bar. To ensure that the image stays behind the status bar, you could use a view controller to keep the image above a scrolling view or you could use a scrolling view to keep it pinned to the top.
Position content to avoid the status bar area (that is, the area defined by the app’s statusBarFrame property). If you do this, you should use the window’s background color to provide a solid color behind the status bar.
As the status bar is totally transparent and any content can go on top of it, I just create an empty UIToolbar that is 20px height which just looks like a perfect translucent background for the status bar.
This is not an ultimate solution, but it really helps and it is very easy to implement when you don't need a real tool bar.
Thanks to Apple that they do not provide an option to set the status bar from transparent to translucent.
In Xcode 6, create top, bottom, left, right constrains and set the
- constants to 0
- priorities to 749.
- Don't forget to UNCHECK the "Constrain to margins" check box.
How to create constrains?
At the bottom right of your storyboard window, there's four buttons. The second from your left has the constrains. Please google about constrains in Xcode 6 since it's a kinda new feature.
Hope this help,

uibutton dosnt respond to touch when at a location

Bit of a strange one.
I have a UIButton which works when located anywhere on the view except the top left hand corner when in landscape mode.
I have a navigation bar with a back button nested in the same area but when the the video enters full screen and playback state changes this navigation bar is hidden.
any ideas?
As thought, the problem was occuring due to the hidden navigation bar and the navigation item located in the same place.
The only solution i can find was to remove the navigation bar from superview then add it back when needed.
Your view's hierarchy is not properly configured. To properly configure your hierarchy, you need to navigate to either the xib or storyboard that you're working with, and re-order the button so that it's on top of anything that falls within it's similar bounds. A common example is that you added a UIView, which is clear, and you had the button underneath it, and now you can't interact with it even though you can't see it.

How to add a bar on top of the iphone screen (below status bar)?

Can someone advise me on how I can implement a "touch to return to call" type of UI as seen in the screenshot below?
My intention is to display the bar on top when my application receives a notification.
Any guide or resources on this will be greatly appreciated
There is several ways how you can place something below your status bar.
1. You can add UIView to UIWindow and position it to be under status bar. Set status bar style to black translucent, so the underneath view will be visible. Resize rootViewController appropriately, so it won't overlap your view.
2. Also, you can set wantsFullScreenLayout property of your rootViewController to true, so it'll cover the entire screen and manage view hierarchy inside it. You also need to set status bar style to black translucent.
Alternatively, you can add views above status bar, but I don't think that this is a good user experience. Here is how you can do that: Add UIView Above All Other Views, Including StatusBar