Question

I have a disclosure button setup in a simple app I am working on that is using BKToolkit. I have hooked up a Disclosure button with Push On Push Off to the toggleCollapse: action in the SplitView. The button works in the aspect that it collapses and reveals the pane correctly. It does not work correctly to hold its own state consistent with the panels appearance.

The button starts with an upwards arrow to show the panel is open. Here is the sequence of events:

  1. I press the button to close the panel. Disclosure arrow now faces down.
  2. I press the button to reveal the panel. Disclosure arrow still faces down.
  3. Any subsequent presses to the button change nothing. The arrow still faces down.

It animates correctly the first time so what is up the subsequent presses not changing the view state of the button?

alt text alt text

This is the erroneous state:

alt text

Was it helpful?

Solution

This is not how the control behaves normally. I was going to ask how you're setting its state but it looks like the split view control in BKToolkit records the first sender to send it the toggle message and manages that sender's state thereafter.

This could be a problem, for instance, if you've got a menu item calling this toggle behavior as well and have been using that to test the toggling. In this case, your button's state wouldn't be updated.

I don't see an easy solution since this behavior is hard wired in the BKToolkit split view's code. Perhaps your controls should call your own toggle method in one of your app's controllers, setting the collapse state directly (so everything agrees on state) and managing all your UI's state yourself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top