Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
4
Answers
iOS 14 comes with new two cell configurations:
UIContentConfiguration
As the name suggests, content configurations can help you manipulate the content of the cell like image, text, secondary text, layout metrics and behaviors.
UIBackgroundConfiguration
can help with the manipulation of background color, visual effect, stroke, insets and corner radius. All cells will inherit a default background configuration even if we don’t specify one.
The Solution
To get rid of the default iOS14 white background you need to change the
UITableViewCell
orUITableViewHeaderFooterView
backgroundConfiguration as followsRead this article for more
Objective-C version of @Husam solution:
In your UITableViewHeaderFooterView / UITableViewCell custom class – override next method with implementation example:
Swift:
Objective-C:
Use iOS 14’s configuration based APIs may disable the functions of those legacy APIs (e.g.
cell.textLabel
,cell.detailTextLabel
).To prevent this system behavior, you can set a
backgroundView
(legacy API) to your header/footer/cell, and then set a custombackgroundColor
for that view.