Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In ios7, UITableViewCellAccessoryDetailDisclosureButton is divided into two different accessory buttons

ios7 UITableViewCellAccessoryDetailDisclosureButtonios6 UITableViewCellAccessoryDetailDisclosureButton

Check mark represents the selected row at that time, left image is of iOS7 simulator and right is of iOS6 simulator.

The concern is UITableViewCellAccessoryDetailDisclosureButton in iOS7 has two parts, one part with right arrow accessory and other is the clickable "i" button rather than iOS6. Is it a standard behaviour or am I doing something wrong, if it is standard then what should be the correct way of handling UITableViewCellAccessoryDetailDisclosureButton in iOS7?

like image 204
Yogesh Maheshwari Avatar asked Sep 11 '13 11:09

Yogesh Maheshwari


2 Answers

mahboudz is correct in that the behaviours are now differentiated.

If you set only the DetailButton then in iOS7 you will see the (i) as a tap-able accessory button. But in iOS6 you won't see anything. So popping a detail view using accessoryButtonTappedForRowWithIndexPath using SDK7.0 doesn't work on an iOS6 device as no accessory gets displayed.

Using the reverse config has similar issues, but you would be using didSelectRowAtIndexPath instead.

The work around I found was to apply a similar approach to the dealing with the extendedLayouts in iOS7.

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
    cell.accessoryType =  UITableViewCellAccessoryDetailButton;
} else {
    cell.accessoryType =  UITableViewCellAccessoryDetailDisclosureButton;
}

So in iOS7 I use the DetailButton only and in pre-iOS7 versions I use the DetailDiscloureButton.

like image 129
Hubert Avatar answered Oct 19 '22 05:10

Hubert


This is the correct behavior. In iOS 7, you show both the "detail button" and the "disclosure indicator" using UITableViewCellAccessoryDetailDisclosureButton.

If you'd only like the "i" button, you'd use UITableViewCellAccessoryDetailButton and if you'd only like the "disclosure indicator, you'd use UITableViewCellAccessoryDisclosureIndicator.

like image 33
Mick MacCallum Avatar answered Oct 19 '22 04:10

Mick MacCallum