How to mask UITableViewCells underneath a UITableView Transparent Header

后端 未结 10 1930
后悔当初
后悔当初 2020-12-08 07:29

I want the header to mask the cells, but not the background.

I have a UITableView with transparent headers and cells similar to Apple\'s Notification Center (when yo

10条回答
  •  遥遥无期
    2020-12-08 07:30

    I have two possible solutions, no code - just the idea:

    1. not generic, should work with the settup/design apple uses at the Notification Center.

    Make the Section-Header opaque, 'clone' the background-pattern of the table as background of the section-Header. Position the background-pattern depending on the section-header offset.


    1. genereic, but probably more performance problems. Should work fine with few cells.

    Add a Alpha Mask to all cell-layers. Move the Alpha Mask depending on the cell-position.


    (use scrollViewDidScroll delegate method to maintain the background-pattern / Alpha-Mask offset).

提交回复
热议问题