How to add a grey description bar under UINavigationBar? - ios

Like this one
http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284862083&mt=8&ign-mpt=uo%3D4
The grey bar with text "Most E-Mailed..." will always stay on top when the user scroll the content.
Can anyone give me an idea how to make this?

You can simply add an imageview with this image and set a label on it with what text you wanna display. I think this is what you want.

Here's a blog entry by someone who dissects how the NYTimes app was made: http://www.cocoanetics.com/2010/12/bars-like-the-new-york-times-app/

Related

In iOS, is there a way to add (overlay) a subview of a UIBarButtonItem image without it moving the buttons already in the bar?

I have my swift 5 app working and I'm now adding a 'tool tips' feature, explaining what each part of the screen does.
The approach I have taken is from an article online - add a subview of grey to dim the background, then to that, add a subview of the item being described again, so it is now highlighted, then also, add a subview of an explainer bubble to explain the item highlighted.
This works fine, so long as the UIView I'm using isn't from a UIBarButtonItem. When it is, the bar buttons underneath the grey screen move around to accomodate what they believe is another bar button being added, which causes everything to miss-align. Other buttons do not have this problem, only UIBarButtons.
Any advice is greatly appreciated. Thanks.
Are you adding the duplicate subview to the bar itself? It'd probably be better to add it to the screen rather than the bar so it doesn't affect the bar's layout. In order to get its frame relative to the view controller so you can display your duplicate in the correct position, you could use:
barButtonItem.convert(barButtonItem.bounds, to: self.view)
Assuming self is a UIViewController.

iOS 11 - Adding Background image to Navigation bar

I have a view controller with Large Titles and I want to add a background image to it so it takes up the whole navigation bar.
Does anyone know the best way to do this. I've search all over the internet but yet to find any good examples.
Thank you
Goal is to look like this view from starbucks app.
I have checked the image. I think the best way is to add an image view at top. Then on that image view place two buttons with appropriate constraints. Then underneath that image view, add the tableview. Then in the table view cell, at first index you can add the textview, if it is a large text and underneath cells will cover all the things your require with labels in the left and the > image in the right which will lead to a different screen.
I ran into a similar problem just like this and I didn't find any solution over the internet neither. But I do have a simple work around that might be helpful.
What I did is setting the image as navigation bar's background and also add the image to the view in the VC. Make sure the navigation bar has no shadow and its translucent property is set to NO.

How to change background color of a UIImagePickerController's Table View?

Using the UIImagePickerController to bring up the following window.
Am able to change the navigation bar color and their text attributes no problem.
How to change the background of this table view's cells AND the background color of this tableView?
Basically all the area that has been painted red is the area I'm trying to change the color of. Please help. Thank you.
UIImagePickerController is not intended to be modified. It should have the system default style and if you modified that, your app will get rejected.
If you want to customize it, you need to look at some custom image picker, not the one that is provided to you by default.

Why does the UINavigationBar cut off part of my UIBuilder but not cut it off when tested?

As you can see in the image (in the UIBuilder), the UINavigationBar takes up probably 60px of space at the top, but that does NOT show up in the simulator. The image you see above it how I have to put those view in order for them to be as far from the top of the status bar as they are from the sides. How can I fix this?
As suggested by user vaibhav, this fixed the issue.
You need to click on your main view, go to attribute inspector, and un-click 'Adjust Scroll View Insets'. That is all. Thanks for the help!

can't set image for Bar Button Item

I'm using Objective-C. In Xcode, I set a image(.png) to a navigation bar button item. But no matter how I change the resolution of the image, it always going to be a blue pic, big or small.
It looks like this(the right top corner):
Does the picture cause the problem? How to solve it? Thanks in advance!
It is because of Barbutton's size is fixed.
So , my advice is add UIView as Barbutton item and then add UIButton and set image According to your required size.
Check output in below image.
Your Hierarchy will be something like this ,

Resources