User Interface

iPhone Developer Tips Visitor Stats:
126,691 Pageviews and 94,296 visitors in the past 30 days.



Screen Capture using UIGetScreenImage

Editor’s Note: I read today (7/22/2010) that Apple is no longer approving applications using UIGetScreenImage. I haven’t been able to find an official Apple announcement on this – however, please give this consideration before using this method in your apps. As talked about on TUAW, among other popular blogs, Apple has opened up the API [...]

User Interface

Showing Activity Indicator (spinner) in Table Cells

Following are two ways to display UIActivityIndicatorViews in a cell of a table view (UITableView). The first will add a spinner as an accessory view, which will display the spinner on the right of the cell. The second approach will add a spinner as a subview in the cell. The primary advantage of using a [...]

User Interface

Adding an Activity Indicator (Spinner) to Navigation Bar

In addition to the standard buttons that you can place on a navigation bar (UINavigationBar), adding an activity indicator (UIActivityIndicator) can be helpful when you need a standard location to indicate some type of action is underway, for example downloading a file, performing a search… You add an activity indicator through a custom view as [...]

User Interface

Validate User Input in UITextField, with Smarts to Properly Manage Copy and Paste

I’ve written a short character validation method that you can use as a starting point for validating characters against a character set. For devices running iPhone OS 3.x and thus support copy/paste, this code will also validate characters pasted into a textfield, and if invalid characters are found in the buffer, the input is not [...]

User Interface

UIAlertView without Buttons – Please Wait Dialog

If you’ve ever wanted to show a simple “please wait” dialog without resorting to a custom view, UIAlertView is a good option, and is even more appropriate if you customize the alert such that no buttons are shown. In the figure below you can see how a simple alert can be shown (sans buttons) while [...]

User Interface

Rotate an Image or Button with Animation – Part 2

In a previous post Rotate an Image with Animation – Part 1 I wrote a short code block using CGAffineTransform to rotate an image. Problem is, if you want to rotate an image 360 degrees, or repeat a rotation a specified number of times, you’ll need to take a different approach, which is the focus [...]

User Interface

Detect Taps on UITabBarController and Determining Class Type

I’ve been working on an application which uses a UITabBarController as the primary means of navigation. One of the tabs leads one to a UIViewController that displays a UIWebview as the main user interface. The browser based navigation in the webview is based on a legacy (read WAP) website that has a great deal of [...]

User Interface

Fade Transition – Fade Images In and Out

Although the iPhone includes a number of effects designed for transitioning between views, sometimes a simple fading effect of one image to another, within the same view, is all you need. For example, in a recent application during the application startup, I wanted the splash image to fade away, and another image of the primary [...]

User Interface

UIAlertView and Landscape Mode

I bumped into a rather odd UI issue early last week – I was working on an application which runs entirely in landscape mode. However, when I displayed an alert view, it came up as follows: Setting Landscape Mode In my application, I had the following interface orientation setting inside the info.plist file:

User Interface

Adjust TextField Hidden by Keyboard

Welcome to the first in a series of tips that are based on content from one of O’Reilly’s latest iPhone books, Head First iPhone Development, written by Dan and Tracey Pilone. Each Monday in November I’ll write a tip that is based on ideas and code in the book. Book Giveaway – Every Friday in [...]

User Interface

Sliding Views On and Off Screen – Part 2 – Reader Contributions

One of the more popular posts in the last few months has been Sliding Views On and Off Screen – Part 1 – Creating a Reusable Sliding Message Widget. The post inspired two developers to use the code example as a starting point to come up with a few different approaches to working with sliding [...]

User Interface

Creating Unique Looking Tables with Custom Cells

A reader of this post How to Add “More Content” Indicators asked about how the user interface was constructed for the Bikini.com application, the UI in question is shown below: Creating a Custom Table It’s quite simple to pull this together, it’s nothing more than a UITableView that is transparent so the background shows through. [...]

User Interface

Fix for Troublesome User Interface (UI) Updates

Here’s a quick tip if run into the problem of requesting a UI update (changing label text, starting/stopping spinner) that just don’t seem to take place. This is a simple workaround and isn’t replacement if you need multiple threads given an unresponsive UI due to other time intensive tasks (such as network requests). As an [...]

User Interface

Rotate an Image with Animation – Part 1

Editor’s Note: Part 2 of this post shows how rotate an images, buttons and other UI objects up to 360 degrees as well as rotating objects clockwise or counter-clockwise. Last week I wrote a tip to demonstrate how to move an image on screen using animation. In this post I’ll show how to rotate an [...]

User Interface

Move an Image with Animation

I was recently working on an application where I needed to animate an image moving on the screen. It surprisingly easy to do accomplish this effect. Let’s me show you the method that I came up with. The moveImage method takes five parameters – the image to move, duration of the animation in seconds, the [...]

User Interface