Flex友好提示、警告
Flex 自带的Alert带给用户的体验并不好,对于一些简单的提示来说,这个小题大作了。 <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Script> <![CDATA[ protected function popupBtn_clickHandler(event:MouseEvent):void { AlertUtil.show(this,"hello,world","保存成功"); } ]]> </fx:Script> <fx:Declarations> </fx:Declarations> <s:Button id="popupBtn" x="562" y="273" label="弹窗" click="popupBtn_clickHandler(event)"/> </s:Application>
/** * hisuper_hjx,上午11:05:47 */ package { import skins.AlertLabelSkin; import spark.components.supportClasses.SkinnableComponent; public class AlertLabel extends SkinnableComponent { private var _text:String public function AlertLabel() { super(); setStyle("skinClass",AlertLabelSkin); } [Bindable] public function get text():String { return _text; } public function set text(value:String):void { _text = value; } } }
<?xml version="1.0" encoding="utf-8"?> <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="160" height="100"> <!-- host component --> <fx:Metadata> [HostComponent("AlertLabel")] </fx:Metadata> <s:Group left="0" right="0" top="0" bottom="0"> <s:Group left="0" right="0" top="0" bottom="0"> <s:Rect left="0" right="0" top="0" bottom="0" radiusX="20" radiusY="20"> <s:fill> <s:SolidColor color="0"/> </s:fill> </s:Rect> </s:Group> <s:Label id="label" color="0xffffff" fontSize="18" horizontalCenter="0" text="{hostComponent.text}" verticalCenter="0" fontFamily="微软雅黑"/> </s:Group> </s:Skin> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |