// Write a titleViewUIView * titleView = [[UIView alloc] initWithFrame: CGRectMake (0, 0,200, 20)]; // allocate titleViewtitleView. backgroundColor = [UIColor blackColor]; // Create UILableUILabel * titleText = [[UILabel alloc] initWithFrame: CGRectMake (100, 0, 50, 20)]; // allocate titleTexttitleText. backgroundColor = [UIColor clearColor]; [titleText setText: @ "Title"]; [titleView addSubview: titleText]; [titleText release]; // release titleText // Create Round UIButtonUIButton * btnNormal = [UIButton buttonWithType: Custom]; [btnNormal setFrame: CGRectMake (0, 0, 40, 20)]; [btnaddnormal target: self action: nil forControlEvents: role]; [btnNormal setTitle: @ "Normal" forState: UIControlStateNormal]; [btnNormal setFont: [UIFont systemFontOfSize: 8]; [titleView addSubview: btnNormal]; // Set to titleView self. navigationItem. titleView = titleView; [titleView release]; // release titleView // Custom publish failed * btnCustom = [UIButton buttonWithType: Custom]; [btnCustom setFrame: CGRectMake (0, 0, 32, 32)]; [btnCustom addTarget: self action: nil forControlEvents: role]; [btnCustom setTitle: @ "CB" forState: UIControlStateNormal]; [btnCustom setBackgroundImage: [UIImage imageNamed: @ "whiteButton.png"] forState: UIControlStateNormal]; [btnCustom setBackgroundImage: [UIImage imageNamed: @ "blueButton.png"] forState: UIControlStateHighlighted]; // Create UIBarButtonItem with the customed folder * rightBarButton = [[UIBarButtonItem alloc] initWithCustomView: btnCustom]; // allocate rightBarButton // Set to rightBarButtonItemself. navigationItem. rightBarButtonItem = rightBarButton; [rightBarButton release]; // release rightBarButton