Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am having the weirdest of problems with a today widget on iOS.

I have a simple widget with a table view like this: https://grab.edr.io/2e557aa43a34b7460b1eac44cbcaf596.png

The thing is, it only responds to touches (the rows only get highlighted) when I tap one of the labels, and not the rest of the row (which is blank).

This happens on both device and simulator.

I am detecting touches using tableView:didSelectRowAtIndexPath:, so I am not being able to see a problem there.

Here is a screenshot of my storyboard: https://grab.edr.io/c2dc09db20ded2b471dc94ea339141b8.png

Any help or idea would be greatly appreciated!

Thanks.

like image 622
EduAlm Avatar asked Oct 06 '14 19:10

EduAlm


2 Answers

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.

like image 52
EduAlm Avatar answered Oct 20 '22 21:10

EduAlm


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];
like image 7
tom Avatar answered Oct 20 '22 19:10

tom