iPhone-SDK:Tab bar item images are not visible - iphone

I created a Tab Bar Controller which has 5 tab bar items. I am trying to add images for all the items through interface builder. I am also able to choose images and set for the particular tab bar items. But whenever i set an image, it does show blank white screen instead of the complete image. P.S: My image is not corrupted, it is a good image. My image size is 24*24. I am not creating tab bar controller items programmatically.
Any suggestions please?

The images must be PNGs with transparency, and only the mask is used. See http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html

Related

Custom image "more" tab in iOS and image colors in more items

Is there any way to set a custom image for the "more" tab in iOS?
And on the other side the items images that appears when I click in the more tab appears in black. Is there any way to set this image to be in colors?
You could try to implement a custom tabBar like this.
https://github.com/judges/RXCustomTabBar

UITableView has blank space below, can't remove

I have a UITableView that displays some data that is read in at runtime and features a button below it that will refresh the list when clicked. All of that works fine, however there is a problem with the layout on the simulator.
When I run, there is a space at the bottom of the table that pushes the refresh button down. No matter how long the UITableView is, the UIButton will always be kept at that extended distance. If I overlay the bottom with the UIButton, it does display with slightly less padding. I am at a loss of how to fix this.
Image with example of behaviour: http://img864.imageshack.us/img864/9913/screenshot20120326at113.png
I think the problem is that in the interface builder your layout does not show at the same size, because it lacks the navigation bar at the top.
In the visual editor, choose the window hosting your table view, go to the attribute inspector, and choose Navigation bar for the Top Bar entry in the Simulated Metrics section of the inspector. The layout of your design will change. Resize your table view, move your button, rebuild the app, and run it again; this should do the trick.
It looks like it's because you're designing without the navigation bar simulated and you've set up your autoresizing masks incorrectly.
What you can do is either enable the simulated metric (attributes inspector in IB with the main view selected) for the top bar set to Navigation Bar, or you can go and fix your autoresizing masks. They are the red things in the size inspector in IB.
It is because when you designed the screen you didn't consider the navigation bar that is gonna come. Simply add a bar to the screen on the top and rearrange the table and button with proper autoresizing masks. It will fit.

How to tell UINavigationBar to ignore a custom category?

I'm having a little problem with customising an app's navigation bar and using an image picker.
I have a category that overrides the drawRect method of the app's nav bar, it changes the background image to a mostly white image. This works fine except when I call an image picker to let the user choose a pic from their library.
Firstly the image picker's nav bar displays the custom image but its title text is white which gets lost on the white background. And secondly the status bar is semi transparent which looks weird against the white navbar.
Is there anyway I can tell the image picker's nav bar to ignore the category I created and to use its default drawRect method?
Many thanks for any advice.
You cannot make a category apply only sometimes. The way categories work means that you use it always or never. The only workaround I can think of is to somehow check inside of the categories' overridden method to see what instance you're in.

iPhone - Custom Tab Icons, Remove Highlight

I am creating a custom tab bar for my iPhone app and I need to change the images. I have changed the actual tab bar background, but I need to know how to add custom images for the icons and their respective "selected" icons. I also need to remove the square highlight that is default. Pretty much, it just needs to be my icons. Also wondering if the images can be coloured or not. I've looked a lot of this, but no one seems to have the solution.
Someone please help.
hide the inbuilt tabBar view
create your own custom UIView (or UIScrollView in case if you need more number of tabs) with the frame of inbuilt tabBar view and fill up, especially with array of UIButtons & then add your custom view as a subview of the TabBarController.
Play with the UIButton's background image (which is your tab icon image) and its addTarget:action:forControlEvents: in order to set the appropriate selectedIndex value of the TabBarController, i.e. set the selectedIndex according to the button's position in the custom view.
This is how I've implemented :)
No. You cannot customise the tab bar icons in the UITabBar.
They are designed to be used with an alpha masked image.
Someone discovered a way to hack the colours though here: Custom colors in UITabBar

Button has moved upwards when running app in Simulator

I have a strange problem when developing for the iPhone
There is one window (in green) and one view (in orange)
when I try to test my app it looks like this in the iPhone Simulator
you can see the view have moved upwards
is this normal? and how to solve the problem?
many thanks
You're most likely adding the view incorrectly. You could post some code and I could give you a better idea, or if you just want a quick fix, open the orange view in Interface Builder, make it 480 px tall instead of 460, show the simulated status bar and relayout your image.
In Interface Builder you can specify the simulated User interface elements. In the screenshots above you will notice in the green one you can see the status bar and the red one doesn't have it. You can turn on these elements by setting the properties of the view. Press Command-1 when you have the view selected and you will see a list of simulates ui elements you can add, these include the status bar, navigation controller bar and a few others i cant remember off the top of my head. This will allow you to position your ui elements correctly when you have these other elements on the screen.
The other issue with your view is that it is not the same height. have a look at the dimensions (cant remember exactly which one but its Command-2, 3 or 4 when you have the view selected) it should be 320x480, i reckon yours is 320x460... (20 pixels, the height of the status bar)