什么是UIBarButtonItem的可能标题? [英] What's UIBarButtonItem's possibleTitles for?

查看:93
本文介绍了什么是UIBarButtonItem的可能标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在UIKit中,UIBarButtonItem有一个名为possibleTitles的属性。怎么用?

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

推荐答案

我看了文档,它说它在AccelerometerGraph演示。所以我看了一下这个演示。

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

看起来在你把它添加到栏之前,你可以设置 possibleTitles 属性为按钮可能显示的一组字符串。我假设这是按钮取最宽字符串的宽度,所以当你改变标题时,按钮的宽度不会改变。

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.

这篇关于什么是UIBarButtonItem的可能标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆