版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Flex 入门培训,Jason,FLXB实例效果,FLXB实例效果图,FLXB实例制作,页面美化 样式表 - Cascading Style Sheet 外观 - skin,FLXB实例制作,数据CRUD 报表制作 页面美化 发布部署 测试与调试,FLXB实例制作,创建样式表 Step 1: Create a style sheet and a CSS global selector. Return to FlexWebTestDrive.mxml in Design mode. Navigate to the Appearance view and change font and color
2、 styles If you dont want to choose your own values, here are some you can use: font-family: Verdana, font-size: 10, chrome-color: #494949. Switch to Source mode. You will see a new Style tag below the Application tag. In the Package Explorer, you should see a new file, FlexWebTestDrive.css. Open it.
3、 You will see a global CSS selector whose styles will be applied to all components. /* CSS file */ namespace s library:/ namespace mx library:/ global font-family: Verdana; font-size: 10; chrome-color: #494949; ,FLXB实例制作,Step 2: Create a CSS type selector. In Design mode for FlexWebTestDrive.mxml, s
4、elect one of the buttons and in the Properties view set its text to bold and white and change its corner radius to 5. Look at the generated code. ,FLXB实例制作,Return to Design mode and click the Convert to CSS button. In the New Style Rule dialog box, select Specific component .,FLXB实例制作,Step 3:latest
5、css ( FlexWebTestDrive.css ) /* CSS file */ namespace s library:/ namespace mx library:/ global font-family: Verdana; font-size: 10; chrome-color: #494949; symbol-color:#FFFFFF; s|Application skinClass: ClassReference(skins.ApplicationSkin); ,FLXB实例制作, s|TextInput.searchInput skinClass: ClassReferen
6、ce(skins.SearchInputSkin); s|Button.searchButton skinClass: ClassReference(skins.SearchButtonSkin); mx|PieSeries fills:#6B96D0,#5B7FB2,#81A4D0,#7EC2EA,#6B84A5,#686BD0,#6A8AD0; .boldTitles fontWeight:bold; ,FLXB实例制作,应用样式表后的效果图,FLXB实例制作,外观设计 Step 1:Create a new skin for the TextInput control Return to
7、 Design mode of FlexWebTestDrive.mxml. Select the searchTxtTextInput control. In the Properties view, click the button next to the Skin field and select Create Skin . In the New MXML Skin dialog box, set the package to skins and the name to SearchInputSkin; leave the host component set to ponents.Te
8、xtInput, create it as a copy of spark.skins.spark.TextInputSkin, and remove the ActionScript styling code .,FLXB实例制作,Create a new skin for the TextInput control.,FLXB实例制作,Step 2: Set the skinClass in the style sheet. Switch back to Design mode and with the TextInput selected, click Convert to CSS. I
9、n the New Style Rule dialog box, select Specific component with style name and name it searchInput . Make this the style used by the search TextInput control in all the application states.,FLXB实例制作,Step 3: Change the controls spacing. In the SparkSkin tag, set minHeight to 30. In the RichEditableTex
10、t tag, change theleft, right, andtop properties to 10 pixels and itsbottom property to 7. Add these same values to the Label control and also set theincludeInLayout property to true and set itsfontStyle to normal. Your code should appear as shown here: (.) ,FLXB实例制作,Step 4: Round the controls corner
11、s. To each of the three Rect tags, add radius X and radiusY properties set to 3 pixels. Example code for one of the rectangles is shown here: ,FLXB实例制作,Step 5: Add the graphics to the skin. After the states in SearchButtonSkin.mxml, use Code Assist to select the search_icon FXG class Your skin class
12、 should appear as shown here: HostComponent(ponents.Button) ,FLXB实例制作,Step 6: Size and position the icon. Return to SparkButtonSkin and set the minHeight and minWidth properties of the Skin class to 30. In the search_icon tag, set thehorizontalCenter and verticalCenter properties to 0. Step 7: Add a
13、 background rectangle. Above the search_icon tag, add a Rect tag and set itsleft,right,top, and bottom properties to 0. Set its topRightRadiusX,top RightRadiusY,bottom RightRadiusX, and bottomRightRadiusY properties to 3. Set its stroke property to an instance of the SolidColorStroke class with acol
14、or of #1A1A1A. (.) ,FLXB实例制作,Step 8: Add a gradient fill. Set the rectanglesfill property to an instance of the LinearGradient class with arotation of 90. Add a GradientEntry with acolor of 0 x999999 and a color in the up state of 0 x666666. Add a second GradientEntry with acolor of 0 x4D4D4D and a
15、color in the up state of 0 x333333. ,FLXB实例制作,Step 9: Position the search controls. Return to Design mode of FlexWebTestDrive.mxml and reposition the search TextInput and Button controls. Make these the properties for all states. To set the positions for all states, modify the source code or select each control and select Apply Current Properties to all Components.,FLXB实例制作,Step 10: Set the skinClass in the style sheet. With the Search button selected, click Convert to CSS. In the New Style Rule dialog box, select Specific component with style name and name it searchButton (see
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB/T 29862-2026纺织品纤维含量标识技术规范
- 仁爱版八年级英语上册Unit1 Playing Sports课时2 Function:表达偏好与计划教学设计
- 核心素养导向的九年级上学期英语Unit 6阅读语篇深度分析与语言能力建构教学设计
- 基于眼动追踪的视觉行为分析实验教学设计-以硕士研究生教育技术学专业为例
- 2026历史常识面试题目及答案
- 2026模型部署面试题及答案
- 2026区域服务商面试题及答案
- 医院医保内部控制制度
- 医院卫生管理制度
- 寻亲服务突出问题专项整治工作汇报
- 《肺隐球菌》课件
- 交通运输企业主要负责人与安管人员安全培训讲座
- 股骨粗隆间骨折护理疑难病例讨论
- 《资治通鉴》与为将之道知到课后答案智慧树章节测试答案2025年春武警指挥学院
- 陈天强陈婷婷养成计划
- 高三物理电磁学综合练习题
- 外贸销售沟通技巧培训
- 不寐-《中医内科学》教案
- 锂电池行业MES应用解决方案
- 国家安全生产考试证书
- 钢筋挂篮计算书
评论
0/150
提交评论