When I am developing iOS8 Today Extension, I set a UITableViewController as the main view controller.And I met this problem:
When I init the UITableViewCell using initWithStyle:UITableViewCellStyleDefault in cellForRowAtIndexPath, the whole area of one cell can trigger didSelectRowAtIndexPath normally. However when set UITableViewCellStyle to UITableViewCellStyleValue1, UITableViewCellStyleValue2 or UITableViewCellStyleSubtitle, I can only trigger didSelectRowAtIndexPath by click in detailTextLabel or imageView's area. Click in other blank areas will get no respond.
I've tried to set tableview's delegate to self, set detailTextLabel and imageView's setUserInteractionEnabled:false in cellForRowAtIndexPath, and all these do not work. Does anyone have any idea about this?
P.S. I am not using storyboard or xib file,just code.
I've found a same problem on Android: I'd like to click anywhere (blank area) in a list view
I encountered this myself while trying to display UITableView
inside the TodayView
. Although I don't know why is this happening, I found out that this only occurs when the UITableViewCell
background is clearColor
. If you set the background to some other color, didSelectRowAtIndexPath
will be called. However, here's a quick workaround - put UILabel
to stretch on whole area of the cell's contentView
and then the delegate method will be called every time. Anyway, it seems like a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With