Colas
Colas

Reputation: 3573

Tiny dark border on title label of UIBUtton: what is it and how to remove it?

Question

There is a tiny border on title label of UIBUtton, which is not there for UILabels.

[self.button setTitle:@"border" forState:UIControlStateNormal] ;
[self.button setTitleColor:[UIColor yellowColor] forState:UIControlStateNormal] ;

self.label.text = @"no borders!"
self.label.textColor = [UIColor yellowColor] ;

Because of this border, UIButtons with light colors looks "dirty".

What is it and how to remove it?


Pictures

enter image description here enter image description here

Upvotes: 4

Views: 684

Answers (1)

Mehul Patel
Mehul Patel

Reputation: 23053

These are title text border shadows of UIButton.

By default it is looks like dark grey colour for button.

enter image description here

Click on Shadow Color and change it to Clear Color

enter image description here

You can done this by programatically also using this code:

 [self.button setTitleShadowColor:[UIColor clearColor] forState:UIControlStateNormal] ;

Upvotes: 5

Related Questions