iOS Today Extension Table View Rows only detects taps on a label

好久不见. 提交于 2019-11-29 10:47:23

Got an answer back from Apple's Developer Support.

It's an iOS 8 bug.

A workaround for it is to set the opacity of the widget to 0.01.

Using the workaround of a background view with a white background color and alpha of 0.01 causes a slightly visible border on iPads where the notification center doesn't cover the whole screen, especially on the right edge of the table view.

Another workaround without this visual glitch is to use a UILabel as the cell's backgroundView. The label needs no text or background color.

self.backgroundView = [UILabel new];

Workaround: set the opacity(0.01) like this self.view.backgroundColor = [UIColor colorWithWhite:1 alpha:0.01];

Swift 2.1 / iOS 9.1 solution:

self.view.backgroundColor = UIColor(red: (255.0/255.0), green: (255.0/255.0), blue: (255.0/255.0), alpha: 0.01)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!