Search code examples
iosswiftuipopovercontrolleruisegmentedcontroluiactionsheet

iOS Popover or ActionSheet cause UISegmentedControl buttons to be grayed out


How to remove/change this default effect of grayed out buttons on UISegementedControl while presenting UIPopoverController or UIAlertController with ActionSheet style in iOS 11 and Swift 4.

enter image description here


Solution

  • Set the tintAdjustmentMode to .normal on the control or parent view (as opposed to .automatic) to prevent dimming during popover or UIAlert presentations.

    See UIViewTintAdjustmentMode

    This wont affect the fact that they are disabled during the presentation but if its just the coloring you want then this will work.

    Also not dimming is a break of the > iOS7 HIG.