iOS: How to Change the UINavigationBar Background Image

iOS: How to Navigate UITextfields with Next/Done Buttons

Changing the UINavigationBar background image is pretty simple.

In order to do this, first you need to do the following steps:

  1. First you need to set the delegate for each UITextField un you xib to your controller.
  2. You need to define the “tab-order” by setting the tag property for each UITextField

Then implement the following code in you .m controller,

-(BOOL)textFieldShouldReturn:(UITextField*)textField;
{
  NSInteger nextTag = textField.tag + 1;
  // Try to find next responder
  UIResponder* nextResponder = [textField.superview viewWithTag:nextTag];
  if (nextResponder) {
    //Was found , so move to next textField.
    [nextResponder becomeFirstResponder];
  } else {
    // Wasn’t found, so dismiss keyboard.
    [textField resignFirstResponder];
  }
  return NO; // We do not want UITextField to insert line-breaks.

Focus Mode

Contact Request

Close

We will call you right away. All information is kept private