Search code examples
iosuitoolbar

How to adjust the right side margin of UIToolbar so that it can trigger the last button?


I created a UIToolbar in the storyboard.

| button1 button2 button3 button4 |

In the app, when I press the space between the left edge and button1, button1 always gets triggered. However, if I press the space between button4 and the right edge, button4 is not triggered.

Is there a way to allow the right side margin to trigger button4?

Thanks so much,


Solution

  • You could add another button on the right hand side, set its alpha=0, and have it perform the same function as button 4.