Monthly Archive for September, 2009

How to set up your Mac for Rails Development

In this post I will guide you through everything necessary to get your freshly set up Mac — using Leopard or Snow Leopard — ready for Ruby on Rails Development.

Things we’ll install:

Continue reading ‘How to set up your Mac for Rails Development’

Set background image of UITableView

How to set a background image of a UITableView is a very often and common question. Today we will try to answer this.

There are two ways to solve this problem:

  1. Create a new UIView – lets call the view V – set the background image of V and embed a UITableView – lets call it TV – within V. Now set the background color of TV to [UIColor clearColor] and do so for all UITableViewCells. Everything seems to work well but you have to handle some tasks (regarding the UITableView) on your own now like deselcting the currently selected UITableViewCell when returning from a prior pushed view.
  2. The second approach requires less effort but creates a not so pretty side-effect. You can simply create a new UIView, set its background image and send this view to the back of the UITableView. If you do so the background image scrolls with the UITableView. So this solution should only be used if you do not have to many cells, i.e. to create a simple menu screen in a grouped style within your app.

For those guys, implementing the second solution, the following code would be helpful. Put it i.e. in your - (void) viewDidLoad; method or further initialization of your view controller.

Continue reading ‘Set background image of UITableView’

Create custom activity indicator for your iPhone App

Have you ever dreamed of your own custom activity indicator within your iPhone App? The class UIImageView provides a very useful and simple way to implement such a thing. The only thing you have to do is to:

  • Provide a number of images that reflect your indicator animation.
  • Create a new UIImageView instance and set images and animation duration.
  • Position your custom activity indicator within your current view.

To demonstrate the whole process I quickly created some images (I am sure you will style them better than me) which will serve for our animation.

Continue reading ‘Create custom activity indicator for your iPhone App’

UIImageView Fade-In and Fade-Out (pulsating) Animation

Today just a small code snippet to create a nice fade-in-fade-out (or call it pulsating) effect on a given UIImage. To accomplish this within a UIView you have to do only a few steps:

  • Create a UIImageView containing your image.
  • Create the animation with its properties.
  • Set the animation for the specific layer containing your image.

In words of code you will have to do something like the following:

Continue reading ‘UIImageView Fade-In and Fade-Out (pulsating) Animation’