Quote:
Originally Posted by officevalentin
UIImage *customIcon = [UIImage imageNamed:imgName];
UISegmentedControl *customButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:customIcon, nil]];
customButton.segmentedControlStyle = UISegmentedControlStyleBar;
customButton.momentary = YES;
[customButton addTarget:self action:@selector(buttonHint  forControlEvents:UIControlEventAllEvents];
UIBarButtonItem *customBarButton = [[UIBarButtonItem alloc] initWithCustomView:customButton];
self.navigationItem.rightBarButtonItem = customBarButton;
//change the button frame
customBarButton.customView.frame = CGRectMake(0,0,40,0);
[customButton release];
[customBarButton release];

|
how change the image of this uibarbutton bar on click, because the evenet will be fire with UISegmentedControl