How to create image contains a text for UITabBarItem - iphone

I am trying to put an image that contains a text on UITabBarItem.
I went to our Graphics designer and asked him to create an image for me that contains a text "Summary".
He actually did. ( a png image).. but when I put inside the app, I saw a horrible look..
The Image:
How it look in the app:

To create an image for a tab bar or toolbar item, you or your designer must work in the image's alpha channel. The colors in the image don't matter at all, the OS only is interested in the alpha channel. In your case, the background of your image should be fully transparent instead of black.

It is absolutely possible for you to use custom colors and images instead of the ones provided to you by Apple's own UITabBarController. I used the code explained in this (really thorough) tutorial - works great.

Related

adding text to image within image picker

hello i am creating an iOS app using cocoa and xcode
i am very new to the whole thing and have gotten kind of lost.
in part of my application the user must choose a picture from the library or using a camera, then some text is added to it(just like "id cap that").
the question is where would i add the text and how do i save it to the phone?
i know there is a allowsImageEditing property, the question is how to i edit it so that instead of crop and zoom it will add text and have an option of saving.
thank you
The system determines what kind of editing is allowed. You can only tell it whether it's allowed or not, but you cannot choose what type of editing. If you want to add a caption to an image, you'll have to use Core Graphics to do so. Or, if you don't care about the image being saved with the caption on it, you can simply use a UILabel on top of a UIImageView.

How can I prevent Xcode from changing the color of my buttons?

So I've done a button for my iPad app, and I saw something strange. When I run my app in the iOS 5 simulator, it changes the color, and the lines of my button become discontinuous. But when I push it, the button comes back to the right color, and the lines are ok. I think it's something that Xcode does automatically with any button, and I don't find the way to cancel it. Thank you for helping!
PS: The button code is so simple:
IBOutlet UIButton *button;
This is what it should look like:
And this is how it looks in the simulator:
Both tams and JacobFennell have good points, but you should also note that graphics are often represented much differently on the simulator than on a real device. You should try running your app on a device and see if the problem persists; I have had many 'problems' with custom buttons which turned out just to be improper rendering on the part of the simulator.
Since you are using the Interface builder, make sure that you are setting the button type to custom and that you have changed the behavior for all of the states. Under the dropdown menu of where you can set the type they also have StateConfig, where you can configure the look and text of your button for all of its different states: highlighted, default, disabled...Check that those settings are correct as well.
Hope this helps!
Tams
Your button frame size doesn't seem to match the size of your image. Your art should match the (button/view) frame size pixel for pixel, otherwise you may get blurry images and scaling representation artifacts.
Else, you can change the view content mode (UIViewContentMode) of the frame from UIViewContentModeScaleToFill to UIViewContentModeTopLeft

UITabBarItem images just appear as a grey block

I have created .png icons 20 x 20 and when I set the image property in the nib they just appear grey blocks.
Any ideas?
UPDATE: Here is one of the icons!
The standard tabbar icons in iOS are rendered solely from the alpha channel. Colors are ignored completely. Instead of colors you can use different alpha values that lead to a different shade of gray (or blue if selected)
Make the background of your icons transparent.
Download these attached images and pass them to your designer and ask him to just create images like these (when you open them in PS you'll know the difference)
This happened to me in iOS 5, I got around it by setting UIImage Outlet property in the Xib to 'Custom' and then set the label programmtically so : imageOne = [UIImage imageNames#"Dog.png"];
Try saving the file as png interlaced. In photoshop at least it gives you an option of interlaced or normal.

iPhone, Stylish Buttons?

I am trying to work out (or find) a button that looks half decent for use in my app. In the image below I have two buttons at the bottom, the default button (interfaceBuilder) and one using two png images from the Apple UICatalog.
I am a little shocked that apple did not include something a little more stylish in IB. I assume that my only option is to find/use/make a suitable replacement button image. Before I fire up Photoshop does anyone know of any replacement buttons I might use?
gary
What you can do is use a segmented control with just one segment - you get the shading you want and it's not much harder to use than a standard button.
If you want to try out some button designs, you can draw them in Opacity, which includes a template for iPhone buttons. Opacity can output the button as a stretchable PNG for use in the button or as a UIView / UIButton subclass with all the Quartz drawing calls within it.
I recommend having a look into the Three20 library. It provides a TTButton class that can be customized using TTStyles, and its very easy to create your own styles. In the Three20 example app, there are a lot of styles available already, especially styles for navigation bar buttons. They serve as great examples.

Where can I get the original images for the Accessory buttons in a UITableView?

I want to create a custom accessory icon to go to the right of my cell in a UITableView and want it to match the blue >, I have tried creating from scratch and it looks good on its own but when put next to a cell with the blue > it looks messy where the two icons look similar but not of the same style. Does anyone know where I can get hold of the original DetailDisclosure button icon so I can use it as a base for my icon? BTW tried doing a screen capture, but you don't get any transparency information with that.
Regards
Dave
Check this blog post:
http://0xced.blogspot.com/2009/04/extract-uikit-artwork.html
Put that code in a project and run it in the simulator. It will extract the artwork from UIKit and save it in the app's Documents directory. NSLog(documentsPath) to see where they're going. It will save out tons of images for pretty much everything.