Issue related with sectionIndexBackgroundColor of UITableview in dark mode.

Hi everyone,

I'm writing a screen that has used the index list in UITableview and it works well on iP8 and lower in dark mode. My dark color was changed to a gray color (not black as default).

But from iPX and above that don't have a physical home button then it has a problem at the bottom right of the table view. The color in this area is black and it was not the same with sectionIndexBackgroundColor I set for section index is gray.

I have search on google but I have not found a solution to fix it. Do you know how to fix it?

See the image (https://drive.google.com/file/d/1c-MAEkue4hOuBVialCBeHdrpjLYNmNu4/view?usp=sharing)

Answered by Claude31 in 688934022

You should limit the size (height) to your tableView to the safe area.

In addition, it is not very convenient to have it overlap the bar at the bottom.

To do this, set a constraint on the tableView relative to bottom of safeArea (bottom of tableView = bottom of Safe area). That will not change in iPhone 8 (without notch) but avoid the bad looking effect in others.

Accepted Answer

You should limit the size (height) to your tableView to the safe area.

In addition, it is not very convenient to have it overlap the bar at the bottom.

To do this, set a constraint on the tableView relative to bottom of safeArea (bottom of tableView = bottom of Safe area). That will not change in iPhone 8 (without notch) but avoid the bad looking effect in others.

Issue related with sectionIndexBackgroundColor of UITableview in dark mode.
 
 
Q