I want to create a UIBarButtonItem with a custom image, but I don\'t want the border that iPhone adds, as my Image has a special border.
It\'s the same as the back b
I found it this ways easy. It is sugested on top. "random.png" has to be in project. Just drag and drop any image.
UIButton *a1 = [UIButton buttonWithType:UIButtonTypeCustom];
[a1 setFrame:CGRectMake(0.0f, 0.0f, 25.0f, 25.0f)];
[a1 addTarget:self action:@selector(randomMsg) forControlEvents:UIControlEventTouchUpInside];
[a1 setImage:[UIImage imageNamed:@"config.png"] forState:UIControlStateNormal];
UIBarButtonItem *random = [[UIBarButtonItem alloc] initWithCustomView:a1];
//? line incomplete ?// imageNamed:@"random.png"] style:UIBarButtonItemStylePlain target:self action:@selector(randomMsg)];
self.navigationItem.rightBarButtonItem = random;