Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Since iOS 7 SDK, UIButton suddenly becomes dark when highlighted

Tags:

ios7

uibutton

A UIButton with a custom background image for normal and highlighted states, suddenly became dark when highlighted, after migrating to iOS 7 SDK.

adjustsImageWhenHighlighted was set to NO and it was working fine up until the new SDK.

Button is defined in a XIB and being assigned with text later in code.

What was changed?

like image 872
Kof Avatar asked Oct 03 '13 14:10

Kof


1 Answers

It turns out that during the migration, the interface builder changed the button type from Custom into System.

System buttons do this behaviour, even when adjustsImageWhenHighlighted is turned off.

After changing button type back to Custom, issue was fixed.

like image 182
Kof Avatar answered Nov 12 '22 06:11

Kof