Monthly Archive for June, 2009

UITableViewCell with detail label

Creating some UITableViewCells with a main label and a secondary detail label (as we allready knew from the e.g. settings menu on the iPhone) to show some kind of a selected value isn’t very complicated but annoying anyway. The ways to do that were either to create a label as subview programmatically or you used the Interface Builder to provide a nib file including the cell.

This common task was greatly facilitated by the introduction of the new iPhone SDK 3.0, which now supports a few styles for UITableViewCells (see UITableViewCellStyle for more information). The following example shows how to create such a simple table cell:

//create a cell with the style UITableViewCellStyleValue1
UITableViewCell *cell = [[UITableViewCell alloc]
			 initWithStyle:UITableViewCellStyleValue1
			 reuseIdentifier:@"yourReuseIdentifier"];
 
//the main label will be shown on the left side
[cell.textLabel	setText:@"mainLabel"];
 
//the detail label will be shown on the right side
//in blue color, right-aligned and in a smaller font size
[cell.detailTextLabel setText:@"detailLabel"];

The result of this will be something like that:

tableviewcell_with_detail

Android Firmware Upgrade 1.5 on MacOS

After finally getting a G1 from T-Mobile for testing purposes I quickly realized it is pretty useless if you want to do edge development because you are not allowed to upgrade the latest firmware (at least not straightforward because you need a signed version from T-Mobile). So I ordered an Android Dev Phone 1 which arrived incredibly fast and came in an incredibly unimaginative box that smelled like gummy bears :) .

After unboxing I started the upgrade process, and as there of course were some minor complications I will outline the detailed steps here.

Continue reading ‘Android Firmware Upgrade 1.5 on MacOS’

Multiple UIBarButtonItems in UINavigationBar

Ever wondered how to place more than one button into a navigation bar in your app? I know it doesn’t look neat at all! The class UIBarButtonItem allows us to initialize a new instance with a custom view. This instance can be used as a kind of a toolbar and you can put as much buttons as you like in there. The toolbar again can be used for the rigthtBarButtonItem or leftBarButtonItem. Please remember:

  • Keep your interface clean and simple and
  • Be consistent with the iPhone Human Interface Guideline

For those guys, who still demand on more than one button on the left or right side of a navigation bar, the following code snippet could be useful.

Continue reading ‘Multiple UIBarButtonItems in UINavigationBar’

Glossy UIButtons (for iPhone)

Sadly, we couldn’t find the glossy buttons which are used e.g. in the UIActionSheet within the iPhone SDK. For this case we made some graphics to get along with that. You will find the images below and you can use them under the creative commons license as mentioned at the end of this post.

Creative Commons License
Glossy Buttons by Andreas Katzian are under Creative Commons 3.0 License.