How to make tableview's content displayed under a transparent navigation bar? - iphone

How to make tableview's content displayed under a transparent navigation bar?
Like this:In "Photos" app, albums displayed under navigation bar.
Special thanks

If you use _rootNavigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent; then set correct tableview frame thats it. If you are in xib dont forget to simulate the translucent navigation bar.

One way I have found to accomplish this is by shifting your tableview's superview up to have the origin at {0, 0}. However after researching more several people have said altering the superview (UIViewControllerWrapperView) is a bad idea. However I also have not found any information on why just changing the frame would create problems. I am shifting the superview right now and haven't found any problems related to it yet.

Might be you can set it like this:
[navigationBar setAlpha:0.5f];

For making the navigation bar transparent alone, you can check this post, How to make a Navigation bar transparent and fade out like in the photo app in the iPhone
Also check this How to set the transparency color for Toolbar and Navigation bar using MonoTouch?
I am not sure whether you can add the table view behind the navigation bar. You might have to add it as a subview of self.parentViewController.view.
Another way to do this is by hiding navigation bar and using a transparent tool bar in place of that. This can be added on top of the current view. The only problem is with the back button. You might have to use custom button for that.

Related

UITableView won't scroll behind blur views, tab bar, or navigation bar

I'm making a simple app and I love using blue effects throughout the UI. Normally if I use a tableView I pin the 4 edges all the way out to the edge of the viewController, and everything scrolls correctly "behind" the blurred navigation bar and tab bar.
However, for one scene I want one view "Original Post VisualFX View" to be "pinned" at the top while the answer fields scroll behind that view and the nav/bottom bars.
Here's the view hierarchy:
Even after I turned off "clip to bounds" on the tableview as well as every view in the hierarchy above it, I can only get the tableView to scroll a BIT behind the Original Post VisualFX View and the bottom tab bar before they disappear. I assume it's because tableViews don't draw things that aren't visible at all within its bounds.
I'm trying to do everything in the Storyboard in IB with as little code as possible. I feel like this shouldn't be that hard, right?
So after tinkering for a while, I found a workaround: use a TableViewController for the whole scene, and just use a custom TableViewCell as the header, which pins it at the top when you scroll. By using ClearColor for the background and putting a UIVisualEffectView with blur in the background, I'm able to get everything to work beautifully.

How to add an image view sharing between navigation bar and view?

I had to add an image so that half of it is in the navigation bar and remaining is in the view.I know there is always a probability of adding two images,but i want to know is there any way to add an image view(only one)between the two?Now i know i can do this way ,
[self.navigationController.navigationBar addSubview:imageView];
and also self.view addSubview:imageView,but i need a single image view to be shared between the two
ie the first half is in navigation bar and the remaning is in the view.can anybody help me on this?
No, this is not possible AFAIK. A view (including a UIImageView) can only have one superview. SO it's either a child of the UINavigationBar or one of the other view, but not both.
with ios 7 you can use translucent navigations bars so that you can set the imageview in your view and it shines through the navbar :-)

Making the tab bar scrollable in iphone?

I have an Iphone application in which I had 10 tab items in the tab bar.
I don't want to add the more button behaviour of the tab bar here.
Instead of that I need to make my tab bar as scrollable.
Can anybody had the idea or links to illustrate this?
Can anybody guide me in the right direction?
But You can not use the UITabbar. You need to create custom UITabbar that behave the same.
Here are links of some projects will help you more.
Infinte Tab Bar
Scrollable Tab Bar
Have you tried looking here?
How to make a horizontal scrollable UITabBar in iOS?
Although, and this is the reason im not writing a comment, i would not use a scrollview, as described in the accepted answer. Instead, i would go for a uipickerview, and rotate it 90 degrees using CGAffineTransformRotate. Let me know if this works.
1) define UIScrollview *scrollview
2) drag and drop scroll view
3) connect instance and delegate in xib
4) set frame of scrollview more so it is scrollable and more than view size
5) add uitabbar as subview to scrollview
[uitabar instance addsubview:scrollview];

UISegmentedControl inside UIToolbar does have wrong height for Lanfscape

Somehow the Segmented Control does not get the proper height when the iPhone is in Landscape.
It is already bad enough when rotating the simulator that the toolbar at the bottom doesn't get thinner height, but when navigating back to the previous screen and then in again, the toolbar does get the propper height, but the segmented control extends above it, and even looks much bigger.
Is the is bug in the simulator or am i doing something wrong?
After digging around another day, I found where it all went wrong!
When dealing with UINavigationControllers, DO NOT drag in a UIToolbar at all! UINavigationController comes with two bars, a top-bar for the Navigation Controller and a bottom-bar for the ToolBar - that latter one is hidden by default.
In any newly added ViewControllers, there will be a toolbar that can be populated from the IB. However, if it is not a UIBarButton, there are some issues. To use a stepper, on/off-switch or a segmented control, drag it first to the Navigation bar, and then in the left column navigator of IB, drag it to the toolbar.
This solved all the problems mentioned before

UIScrollView Indicator Bar

I was looking at the Apple docs for UIScrollView and saw that the constants for UIScrollView Indicator bars are "default", "black", and "white". I was thinking about using a scrollView without showing the indicator bar on the side of view. I have a very specific case and the bar is making it look awkward and actually seems to be distracting because of it.
If I have a black background and use a black bar I think this would hide it well. Is there a way to turn it off or move it off screen?
Has anyone done this without Apple rejecting it? Or is this a violation of the HIG in some way?
You can hide scrolling indicators if you want - see showsHorizontalScrollIndicator and showsVerticalScrollIndicator properties in UIScrollView. You can set them in IB as well.
UIScrollView has a couple of properties to disable the scroll indicators. Those are:
showsVerticalScrollIndicator
showsHorizontalScrollIndicator
Set them to NO, either in code or IB, to disable the indicators.