如何在按钮标签中写入两行文本?
对于按钮的“标签”字段,有没有办法在多行上显示文本?或者自动将文本“换行”成几行而不是剪切其中的一部分?
Is there a way, for a Button's "label" field, to display text over several lines? Or else to automatically "wrap" the text in several lines instead of cutting part of it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这对于标准 mx:Button 来说是不可能的 - 您可以创建自己的自定义组件来扩展 Button 或查找其他已经创建了您需要的组件。
例如,flexlib 库包含一个 CanvasButton ,它可以帮助:
http://flexlib.googlecode.com/svn/trunk/docs /flexlib/controls/CanvasButton.html
或者,如果您喜欢自己动手并创建自己的自定义组件,这篇博文将向您展示如何:
http://www.forestandthetrees.com/2008/03/11/弹性多行按钮/
This isn't possible with the standard mx:Button - you can either create your own custom component to extend Button or look for others that have already created what you need.
For example the flexlib library contains a CanvasButton which would help:
http://flexlib.googlecode.com/svn/trunk/docs/flexlib/controls/CanvasButton.html
Or if you prefer to do it yourself and create your own custom component this blog post will show you how:
http://www.forestandthetrees.com/2008/03/11/flex-multiline-button/
假设您使用的是 Flex 4,您可以使用此组件:
WrappingButton.as
Assuming you're using Flex 4, you could use this component:
WrappingButton.as
如果您使用的是 Flex 4,则使用 s:button,然后为其制作自定义皮肤。在皮肤里面你会看到
If you are using Flex 4 then use s:button and then make a custom Skin for it. Inside the Skin you will see