custom navigation bar? - objective-c

I have a custom navigation bar that looks like this:
I set it as the background image of the navigation bar. But how do I implement the buttons? I want to be able to click on the individual text and have an action happen
Could I possibly add a gesture recognizer over each word on the image?

Put an invisible button on the toolbar for each place you want to have a button. If you want this to look and behave exactly like a normal toolbar, however, you can't have the buttons be part of the background image. It's very easy to make a toolbar that looks like what you have in IB.
It took longer to upload this to imgur than it did to make it!

Related

Make an NSToolbar's fullScreenAccessoryView visible at launch

I am trying to make an application with a toolbar controller which view is shown, and for each view shown I want to include a second 'row' for the toolbar, and I found out that to do this you had to do [toolbar setFullScreenAccessoryView:view]. However, the view does not appear until the user toggles fullscreen mode and the accessory view remains after toggling the window back to windowed mode. I would like it to look like the following examples from Mail.app, Preview.app, Dictionary.app:
just place a custom view underneath the NSToolbarView .. so at the top of the window.
dont misuse the fullscreenAccessory view. it if meant for something else.
see How to create a toolbar with "Search" Finder style, rounded buttons working like radio
(it could be any other view too btw :D)

How can I avoid my UITextView from being covered by my UITableView?

I have created a forum with a View, and in the View I have placed a Text Field. My problem is, whenever I slide up they keyboard the text from the tableView are placed over the UIView and the TextField being covered. Any Idea what the reason behind this might be? While we are at it, maybe I shouldnt create a View with a TextField and instead use the standard look in iPhone sms apps, but I dont know how they created that bar. Any Ideas? I post all pictures below:
iPhone standard look, how to create something like this?:
My View with the text field:
My problem as i described above:
You can create a custom view for that and add it as an inputAccessoryView of the keyboard.
For more details please check apple documentation on this. When the keyboard is dismissed, show this view at bottom of the screen and when keyboard appears remove it from bottom and make it as inputAccessoryView.
inputAccessoryView:
The custom accessory view to display when the text view becomes the
first responder

How do you vertically centering an image on an NSButton

I'm build a Mac application in the style of the Lion Mail.app. As part of this I'm attempting to create a simular toolbar to the one in the Mail.app but I can't seem to get the image in my toolbar button centered vertically.
Looking at the Mail.app toolbar I see a nice series of buttons with centered icons:
but when I go interface builder I can't seem to recreate the same button. What I get is:
What I've tried doing is, in Interface Builder:
Create a new window
Add a NSToolbar to that window
Add an NSButton to the toolbar with Style - 'Push', Image - 'Envelope', Position - 'NSImageOnly', Scaling - 'Proportionally Down'
As you can see the icon is clearly not centered vertically on the button like those in the Mail.app toolbar.
Anybody have any ideas???
At the moment I'm using XCode 4.2 and laying out this button with Interface Builder. I'm trying to build the toolbar button by ONLY adding the image to the button and not painting the button for each item, ie drawing the border and icon.
Any help would be greatly appreciated as this has been driving me a little nuts.
Thanks in advance - AYAL
Turns out the answer to this problem was much simpler then I had expected. After a lot of teeth gnashing, hair pulling, and twiddling pixels I came across the solution.
Instead of using a 'Push' button I simply had to switch to a 'Round Textured' button. Once I did that any image I added to the button was nicely centered. Next I just had to manually scale my image to look right.
The recipe then for a Mail.app Toolbar is as follows:
Add a button to your Toolbar
Set the button style to 'Rounded Textured'
Set the image of the button
Set the position to 'NSImageOnly'
Set the button size to 40 x 25 as well as the min and max sizes of the ToolbarItem
The result is a toolbar that can look very simular to the Mail.app toolbar.
Thanks All - AYAL
One way to do it is to have your image actually be the button i.e. take up all of the button's canvas. You will have to use the button's setBordered: method so the button's border is not drawn.
you could make the button image in something like gimp or photoshop then use that as the background or image for the button.
i feel like your going to say "this is what im doing". and maybe you made the little mail icon but i mean for you to make the whole button, outline and everything, then use that for the button image. make sense?
like here, just use this as the background

Custom button with style of NavigationBar back button

Is it possible to make a custom button that looks like a back button in NavigationBar? I mean the shape of the left side that is like an arrow.
No, there isn't. You will have to draw it yourself to an image file and set it as a background to your custom button.

Why and how do I change my buttons style, my the other compose button is fine?

I've changed my navigation bar style to black opaque but my done button remains blue, yet the compose button is fine / black.
Why is is happening and more importantanly how do I fix this ?
The buttons was added in IB and shows blue there, while the nav bar is black.
The best thing to do is to make sure you're using the UIBarButtonSystemItemDone system button item, unaltered. If you really want to change the appearance of your Done button, you will need to assign a custom view to the bar button item's customView property. Then you'll be able to control every aspect of its appearance.