Button icons: round close icon - iphone

I've seen other apps are using a round icon for closing a view. The only similar icon I found is UIBarButtonSystemItemStop. But this presents only a rotated cross with a border (as always with buttons) around it.
I rather would like have something like a UIButtonTypeInfoLight. If this button is used, no border is visible. Also the icon is a round grey icon with a symbol (here i symbol) in it. Are there further icons in this style available? Neither UIBarButtonSystemItem nor UIButtonType is offering that.
I have also seen a thunderbolt icon in the style of UIButtonTypeInfoLight. Are these icons self made? If yes, how are they included so that no border is visible?

These buttons are custom.
You can embed any custom view into bar using [UIBarButtonItem initWithCustomView:].
You can use UIButton with UIButtonTypeCustom type so that you have button with no border. Also set showsTouchWhenHighlighted to YES so that button glows like info button.

Related

UIBarButtonItem displaced when style changed from plain to Done in iOS 7

When I change the bar button style from plain to Done, the button is moving towards the left direction. This is happening only in iOS 7.
In the Interface Builder, I added a UIBarButtonItem to a toolbar and set its style as plain and identifier as custom and an Image. Its width is set as 26.
When the button is clicked I'm changing its style to Done to indicate its in pressed state. In iOS 7 the button position is moving towards the left. Anyone has any clue on this ?

Align icons TabBar

Well I have a problem,
I'm doing the reverse for my iPad app, but I want my tabbar is exactly like this:
I'll put the volume controls, play and pause on the left and right side of the tabbar icons ....
how can I change the position of them?
For alligning the elements, you should take a look at this question:
Aligning UIToolBar items
I'm not sure how to add custom controls to a UIToolbar, but I'd expect you could do this by setting their frame to overlap the UIToolbar.

adding icon to uisearchbar

Can I add an icon to the uisearch bar like this
Ya you can add the icon if you are talking about the image on left then just add a image and if you are talking about the image to the right. which i think is a search button then you can add a button and do your search code on it.
ok so what you have to do now is, i am assuming that you want to implement the search bar with icon on the toolbar. just add a UIButton and in the IB select the UIButton and go to attribute inspector and set the type to custom.
Now when you add the image to it(set the background property to the image you have selected)
By doing this you can easily resize your image.(means just resize the button, it will automatically resize your image too).
hope this will work.

UIToolbar and Flexable/Fixed bar button items

I have a toolbar, where I want to have one UIBarButtonItem centered and have another on the very right. However when I add the button on the right, my centered button gets shifted further to the left (see attached). I can't figure out how to get this resolved without using code (I would like to use interface builder only). Any ideas?
To do this in just IB, add a fixed bar button item to the very left of the bar that's the exact same width of the 'switch camera' button, followed by a flexible button, your camera icon, another flexible space, and the switch camera.
So it would look like:
|--fixed space--||--flexible space--||Camera Button||--flexible space--||switch camera|

UIBarButtonItem in middle of navbar?

I have created a flexible navigation bar in my app that will show custom buttons on the left, right, and in the middle. So far I have got working:
Right/Left/Middle - Custom Image and/or Text
Right/Left - Normal looking button with custom Image in it
Right/Left - Normal looking button with custom Text in it
By 'normal looking' I mean the default UIBarButtonItemStyle- just a nice shiny button.
My question is, how can I achieve the same look in the MIDDLE of the nav bar? I can do custom/text images by just creating a custom UIButton, and on the right / left I create a UIBarButtonItem from it, but in the middle I just add the UIButton view as a subview of the navbar.
I can't add a UIBarButtonItem to the navbar as a subview, and any UIButton I create doesn't look like a UIBarButtonItem.
The only workaround I can think of is to use a stretchable custom image that I steal from a screenshot. I'd rather avoid doing it this way. Am I missing something?
*********** UPDATE **************
The open source library Three20 will allow you to create UIButtons that look like UIBarButtonItems. Then you can add them to the bar view either by placing manually as a subview or by setting the title view.
I never understood why they didn't make UIBarButtonItems derive from UIViews (or even better, UIButtons) so they could be used elsewhere.
Sounds like you're on the right track, but need better artwork :-) You can get a large number of iPhone UI components in a Photoshop .PSD file from here. They have pre-rendered bar buttons which you can use as a base for a standard UIButton image. If you have Photoshop (or a decent drawing program) you can stretch the buttons from the middle to fit your size without getting the corners distorted. Just add the label and you should be good to go.
Put a flexible region on the left and right, they will offset each other causing anything between them to be centered