UIViewController: Preferred way to handle Content scrolling behind transparent status bar - uitableview

With iOS 7 we get the fancy transparent/blurry status and navigation bars.
I saw many posts here on SO talking about the content being overlapped by the status bar.
I understand why this is happening and it's ok in my case.
Now, I was wondering since I don't have navigation bars in my app:
How shall I handle any content being scrolled behind the transparent status bar.
(Note: By scrolling I mean real scrolling through content)
In my opinion it doesn't look nice if the status bar simply overlaps the content.
Is there an easy way to make it look "nicer"? Or do I have to play with offsets and manual blur to achieve a better look?

If I have understood the question, could you not place the background image to cover the entire screen and offset the scroll view y position by 20px (the height of the status bar).
Therefore you still get the nice effect of the transparent status bar but no content ever going under the bar itself.

Related

Can I add a bottom padding to iOS UINavigationBar to alter the visual height of the bar?

I’m implementing a design that requires the navigation bar to visually appear to be 64px tall (even though the content fits inside the standard height). The standard UINavigationBar height on iOS is 44px and it is strongly discouraged try to to change the that (see: https://developer.apple.com/forums/thread/88202?answerId=274620022#274620022).
So, what I’m trying to do instead is to add a padding of 10px both above and below the bar itself, but I can’t figure out if this is even possible.
I am able to extend the bar by 20px by setting the UINavigationController’s additionalSafeAreaInsets.top = 20, but the bottom of the navigation bar is still flush with the bottom of the navigation controller, and I need it to be -10px from bottom.
So, my question, is this possible, or am I chasing a ghost here?
EDIT: To clarify, I want it to look like how the navigation bar looks in the iMessage conversation view, i.e. a tall navigation bar, but with vertically centered content.
I think you should make a customized navigation bar to solve this issue.
Because built-in UI is not easier to adjust or customize. I have tried many tricks but they didn't work.
I already made a base screen that automatically adds a navigation bar on top, just need to set left/right button and the label. This navigation bar is just a normal UIView.

Prevent In-Call Status Bar from Affecting View

Is it possible to prevent the in-call status bar from affecting my app's views?
I would like the in-call status bar to ideally simply appear on top of my view and not affect its frame (neither by changing the height nor by changing the origin and pushing the view down).
Is that possible?
Answering my own question, the best solution I was able to find for this is to manually change the main view's frame to start at the origin and have the size of the entire screen (both width and height). That way, you receive the same effect as you would if you were to use a navigation controller for example, where the view remains in place and the in-call status bar appears to be on top of it (on a different layer, without affecting the app view's display).

How to make statusbar not transparent (storyboard)

I've got a pretty straightforward question and somehow I didn't find an answer on this site yet.
I've got a view with a background a yellow color. I'm displaying content in the view and in order for the statusbar to not conflict with the content, I want the background to be non-transparent and preferably set to specific color.
How do I do this with storyboards?
The only way I see is to add a 20 height view aligned to the top of the view to act as a status bar background.
20 is the current size of the status bar but it's better if u get it programatically.
[UIApplication sharedApplication].statusBarFrame.size.height

Changing the status bar color gradually

Changing the status bar's text color in iOS7 is simple and there is a lot of information on that topic.
So, to give you some context, today I saw this tweet:
That links to this video.
I was wondering about how to do that animation and the best way I can think of is:
A screenshot of the status bar with black text color that is inserted on top of the real status bar (with white color) and then the real status bar is slowly revealed.
As #Edgar confirmed it it is really what they are doing in the video (if you keep the finger on the screen while the time changes it is possible to see that).
However, this solution isn't good enough because in the meantime the status bar can change and it can become kinda creepy.
Is there a way to do this without a screenshot?
When you start swiping it does a screenshot of the status bar and puts it at the top of the real status bar and then it changes to style UIStatusBarStyleLightContent to UIStatusBarStyleDefault.
You can clearly see this if you play around with it and start the swipe gesture but do not release it, not only after one minute the clock becomes outdated but if you happen to start swiping when the activityIndicator is on, you'll see it stays static.
Unfortunately, as far as I know there's no way to have two status bars, both with the right info. Maybe if you could come up with a way to continually take screenshots of the real one and dynamically invert colors, but that would be expensive, performance wise.
As i know the status bar color depends on the near by view attached to
status bar.
if it is connected to the navigation bar then status bar takes the
color of the navigation bar.
if navigation bar is hidden then the top view that near to the status
bar that color is taken by the status bar.

Any quick solution to make a view appear behind the status bar in iOS 7?

I'm porting my app from iOS 6 to IOS 7 (there will eventually be a complete GUI redesign for iOS 7 but in the meanwhile just getting the existing GUI to display properly on iOS 7 is the goal.
I had the issue where the status bar was overlapping my GUI and so have shifted the Y origin of the view controller's view down by 20.
However my app contains a pulldown which when retracted is overlapping with the status bar. In the screenshot the red is a button which is present in the pulldown view. The grey bar is the top of the main view behind which a portion of pulldown is hiding when retracted.
I implemented the pull down as a fixed size child subview of the main view and when retracted its Y origin is a negative number thus it is effectively still displayed but off the top of the screen. When the user pulls it down I just animate the increase in the Y origin until eventually the origin is 0.
Is there some way I can make the pull down view appear beneath the status bar or some other quick solution?
Note of course I can't simply toggle the pulldown's alpha to display/hide it as it pullsdown obviously thus its appearance/disappearance is not a discreen action. I could maybe attempt to make the portion of it that is on top of the status bar invisible but as its something that is moving that seems like its going to be complicated. Is there any simple solution?
Thanks
Add another view, with a fixed position, under the status bar (with the same color of your grey bar), 20px tall and same width of the status bar, but with a z-index higher than the retracting view. This view will cover the retracting view (but not the status bar) acting as a "background" for the status bar itself. Obviously you have to adjust the Y position of the retracting view to make it tappable by the user (but under the status bar)
iOS 7 by default lets views take up the fullscreen, including the status bar. This is controlled using the UIRectEdgeAll property.
If you want the old style view, set UIRectEdgeNone for self.edgesForExtendedLayout
in viewDidLoad:
self.edgesForExtendedLayout = UIRectEdgeNone;

Resources