下面是完整代码(或点击这里察看):
Download:
main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">
- <mx:Style>
- .roundedAlertButtons {
- cornerRadius: 10;
- font-weight: bold;
- color: black;
- }
- </mx:Style>
- <mx:Script>
- <![CDATA[
- import mx.controls.Alert;
- private var alert:Alert;
- private function showAlert():void {
- alert = Alert.show("The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog.", "I'm an Alert control.", Alert.YES | Alert.NO);
- alert.setStyle("buttonStyleName", "roundedAlertButtons");
- }
- ]]>
- </mx:Script>
- <mx:Buttonlabel="Show alert" click="showAlert();" />
- </mx:Application>
本文转自:http://blog.minidx.com/2008/07/20/1097.html
本文介绍了一种在 Flex 应用程序中自定义 Alert 控件样式的实现方法。通过使用 MXML 和 ActionScript,可以创建带有圆角按钮和加粗字体的警告框,并通过按钮点击触发警报显示。
2275

被折叠的 条评论
为什么被折叠?



