What's UIBarButtonItem's possibleTitles for?

前端 未结 2 1069
刺人心
刺人心 2021-02-15 16:57

In UIKit, UIBarButtonItem has a property called possibleTitles. How is that being used?

2条回答
  •  情话喂你
    2021-02-15 17:11

    I looked at the documentation and it said that it was referenced in the AccelerometerGraph demo. So I took a look at the demo.

    It looks like before you add it to the bar, you can set the possibleTitles property to a set of strings that the button may display. I assume that this is so that the button takes the width of the widest string, so when you change the title the width of the button doesn't change.

提交回复
热议问题