Styling the Alert control’s title bar

简介:
The following example shows how you can customize the appearance of the title in an Alert control in Flex by setting the  titleStyleName  style
<? xml version="1.0" encoding="utf-8" ?>
<!--  http://blog.flexexamples.com/2008/01/03/styling-the-alert-controls-title-bar/  -->
< mx:Application  xmlns:mx ="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white"
        creationComplete
="init();" >

    
< mx:Style >
        @font-face {
            src: local("Comic Sans MS");
            fontFamily: myComicSansMS;
            fontWeight: normal;
        }

        Alert {
            titleStyleName: myCustomTitleStyleName;
        }

        .myCustomTitleStyleName {
            color: haloOrange;
            fontFamily: myComicSansMS;
            fontSize: 16;
            fontWeight: normal;
        }
    
</ mx:Style >

    
< mx:Script >
        
<![CDATA[
            import mx.controls.Alert;

            private var alert:Alert;

            private function init():void {
                var myMessage:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\nDonec tincidunt sollicitudin sem.";
                var myTitle:String = "The quick brown fox jumped over the lazy dog";
                alert = Alert.show(myMessage, myTitle);
            }
        
]]>
    
</ mx:Script >

    
< mx:ApplicationControlBar  dock ="true" >
        
< mx:Button  label ="Launch alert"  click ="init();"   />
    
</ mx:ApplicationControlBar >

</ mx:Application >


    本文转自 OldHawk  博客园博客,原文链接:http://www.cnblogs.com/taobataoma/archive/2008/01/11/1034755.html ,如需转载请自行联系原作者



目录
打赏
0
0
0
0
347
分享
相关文章
|
10月前
|
this code must be changed as there‘s no longer a status bar or status bar window.
this code must be changed as there‘s no longer a status bar or status bar window.
45 0
|
10月前
解决ERROR in Conflict: Multiple assets emit different content to the same filename index.html 的问题
解决ERROR in Conflict: Multiple assets emit different content to the same filename index.html 的问题
985 0
Could not extract response: no suitable HttpMessageConverter found for ..content type [text/html...]
Could not extract response: no suitable HttpMessageConverter found for ..content type [text/html...]
884 0
|
10月前
使用Form报错提示If ngModel is used within a form tag, either the name attribute must be set or the form
使用Form报错提示If ngModel is used within a form tag, either the name attribute must be set or the form
Fragment的replace、add、hide、show的使用和详解
Fragment的replace、add、hide、show的使用和详解
the content is displayed over another view controller’s content
the content is displayed over another view controller’s content
133 0
the content is displayed over another view controller’s content