IOS7 UITableViewCell background transparency becomes opaque after short pause

I have a UITableView presented modally above the view. One of the cells in the table is intentionally transparent so that the bottom view is visible. The problem is that IOS 7.1 starts with a transparent cell and then immediately becomes opaque. In iOS 8, transparent cell technology works great.

Qn. Has anyone seen this and come up with the right job?

What i tried

  • Setting cell.backgroundColor
  • Customizing cellbackgroundView
  • Setting tableView.backgroundColor
  • Setting up the tableView.backgroundView

  • Setting tableView.opaque = YES;

  • Making settings on tableView: cellForRowAtIndexPath:

  • Making settings on tableView: willDisplayCell: forRowAtIndexPath:

  • Using full transparencies

  • Using partial transparencies
  • Using transparent images

  • [[UITableViewCell appearance] setBackgroundColor: [UIColor clearColor]];

Essentially, as soon as transparency is entered in the background, it changes (after a short pause to become opaque).

enter image description here

For re-iteration under iOS7, the transparency exists for a very short time (less than 1/2 s), then it becomes opaque.

Here is the effect of the effect: Link

+3


source to share


3 answers


Instead of focusing on the table and its cells, look at the presentation (bottom) controller. I suppose (although I can't find it officially registered at the moment) that when you make a standard modal presentation of one view controller over another, the view's view of the view is removed from the view hierarchy after the view. Working with a trivial test application, the displaying view controller -viewWillDisappear: is called and the -recursiveDescription key window is registered, the view's view of the view has been removed.

However, if you use a custom transition, the view of the view controller is kept in place (presumably to provide just that kind of transparency effect).



EDIT: I've put together a quick example app (here: https://github.com/sjc/ViewControllerTransitionExample ) at 1) illustrates the difference in behavior between standard and custom modal presentation and 2) show how a base UINavigationController subclass can be created to solve this problem (this method usually only applies to direct subclasses of UIViewController).

However ... While this can be used to solve the problem in this case, it does not answer the question "what's going on here?" question, since the example does not reproduce exactly what you see: the view's view controller disappears on both iOS 7 and 8, not just 7 as described in the original question. Oh good.

+1


source


try to change table cell from Appearance to AppDelegate



[[UITableViewCell appearance] setBackgroundColor:[UIColor clearColor]];

      

+1


source


This won't work on iOS 7 because modal views are always opaque. On iOS 8, they can be transparent. You will need to find another solution on iOS 7.

This seems to work for 1/2 second because the modal views are not opaque during transition.

+1


source







All Articles