Xcode custom UI objects - iphone

I am writing an application with xcode and I'm wondering if it is possible for me to customize the apperance of some of the UI objects as I don't think the current UI objects suite my application.

You can customise almost everything.
The Button - use your own images as backgrounds
TableView - images, custom cell content,
Navigation bar - look at the UIAppearance methods, you can again set any image as the background, or set a tint colour
Text field - this is kind of invisible except for the text, so you can give it a clear background and put it on top of anything you like
Slider - you can set custom images for the track and thumb.

You can make custom classes of UIView or even UIControl to build up an entire new-looking UI system for yourself. If you don't want such radical changes, you can simply modify some properties of the various UI elements you have in UIKit, like backgroundColor, alpha etc.

Related

Any way to adjust a button built with interface builder to reverse when tapped?

I am not a huge fan of interface builder but I am trying to create a UIButton that would highlight when touched. I was thinking the whole button to reverse. I see this property reverses on highlight but what it does is to reverse the text. I want the whole button to reverse color.
This is how I have it now:
This is a green button with rounded corners. Is there a way to make the whole button to reverse from interface builder?
This is an iOS 7 only project.
If you want to keep things inside interface builder, I believe your only option is to configure different background images for each button state. I had the same problem and couldn't find a way to use different UIColors for different button states. If your button style is really minimal, you could potentially use 1x1 pngs and apply rounded corners using Quartz directly in code.
In my case, I ended up creating a custom subclass of UIButton with a setter to configure different colors/text colors and shadows for each state (I used an enum to map different button "themes").

custom tableview with only image

I have a default tableview style with 4 entries and would like to customize it show only 4 large image.
Is possible custom table view or i must use another method?
When you have such a display (a menu like, not a table like) I use simple buttons with the following properties:
Type: Custom
Background: an image in .PNG format since it supports transparency and I can do a nice layout with it.
I either set the Title of the button if it doesn't ruin the design, or I add labels under the buttons to explain what they do. In the TouchUpInside event of the buttons I push the view that I want using a navigation controller.
If you're ONLY using four images, consider using a typical UIViewController and laying out the objects in the nib file.

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

Making large toolbars like the iPod app

I am trying to create a toolbar programatically (rather than via IB) very similar to the toolbar featured in the iPhone app:
Currently I've been experimenting with the UIToolbar class, but I'm not sure how (and if?) you can make the toolbar buttons centrally aligned and large like that in the iPod app.
Additionally, regardless of size, the gradient/reflection artwork never correctly respects the size and is stuck as if the object is the default smaller size.
If this cannot be done with a standard UIToolbar, I guess I need to create my own view. In this case, can the reflection/gradient be created programmatically or will it require some clever alpha tranparency Photoshopped artwork?
The best thing you can do is:
create MyToolbar.h and MyToolbar.m : MyToolbar can be inherited from UIToobar
create an empty xib named MyToolbar.xib
In Interface Builder, add a new UIToolBar with "IB->Tools->Library"
With "IB->Tools->Inspector", change the class identity to "MyToolbar"
Now, you can customize your toolbar with IB or with xCode as you want.

How to realize the same effect like iPhone's homescreen

I want to add some custom buttons and realize the same effect like the iPhone's home screen. What I can think of is to calculate the position of each button and add them to the view. Are there any other ways to do this? e.g. add buttons to the tableview
Check TTLauncherView from Three20,
I realized the same view of the thumbnails in the photo app (which in principle differs only because of the background color and the rounded effect of the buttons) using a custom cell (with 4 UIButtons inside) in a normal tableview.
In my case, this is because I need to scroll up and down, in your specific case there should be a way to "lock" the table from scrolling. By the way, for this reason, it could be simpler to design the custom view in the interface builder, it is very quick to design such a view, and then create a custom controller to provide simple methods to assign icons and actions to the UIButtons dynamically.
You could also look at the Three20 libraries as already suggested, it is already implemented, but you app will easily be rejected by Apple if you do so.