iphone - UINavigation controller button like backButton -


How can I create left or right buttons like the UNIX Controller?

As I understand it, it is not possible to get a button that will create a custom button Takes shape and specifies the image for it. So basically you'll need a button image that is the same size as the default iPhone back button shape.

  UIImage * backImage = [UIImage imageNamed: @ "back_button.png"]; // Change the "Home" button with the white arrow UIButton * BackBackton = [UIButtonTypeCustom] with UIButton Button; [BackButton addTarget: Self-action: @Selector (back) for control events: UIControlEventTouchUpInside]; [Backbutton Setframe: CGRactMake (0.0 F, 0, 20, 20)]; UIImageView * imageView = [[[UIImageView alloc] initWithImage: backImage] autorelease]; [ImageView Set Frame: CGRectMake (0.0f, 0.0f, 20.0f, 20.0f)]; [Backbuttan ed swoewview: image view]; UIBarButtonItem * homeButtonItem = [[[UIBarButtonItem alloc] initWithCustomView: Backbutton] AutoWaves]; Self.navigationItem.leftBarButtonItem = homeButtonItem;  

Comments