Erik
Erik

Reputation: 2530

Fading out a disclosure indicator

I'm building an app where I've got cells that expand, similar to when you create a new event in iOS' built in calendar app. One of the expanding cells have a disclosure indicator set in storyboard, but return nil when logging it. I've tried to set it both in StoryBoard and like this:

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

and I'm trying to fade it out like this:

self.cell.accessoryView.alpha = 0.0f;

but it doesn't work as it's nil.

Can someone help me with this? Why is it nil? I'm using StoryBoard with a UITableViewController that's static and grouped.

Thanks!

Erik

Upvotes: 1

Views: 127

Answers (1)

Ben Kane
Ben Kane

Reputation: 10040

You'd have to provide your own accessoryView. accessoryView will be nil if you're using an accessoryType.

Remember to add a little logic in tableView:cellForRowAtIndexPath: to decide whether or not to show your accessoryView as well since the cells get reused.

Upvotes: 4

Related Questions