版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- T/ZSA 241-2024地面移动式三维激光扫描系统通用技术要求
- T/CSTEA 00012-2020九龙大白茶 白茶加工技术规范
- T/CSAE 506-2026汽车企业海外知识产权合规及风险防范指南
- T/SLA 004-2026儿童阅读推广服务指南
- T/SDJSXH 06-2024塔式起重机顶升安全监控系统
- T/ZBZLXH 012-2024高速公路收费运营区域化管理规范
- T/ZJSEE 0047-2025商业与公共建筑数字化节能控制技术规范
- T/UNP 550-2025加氢石油树脂
- T/SZSA 032-2024SMD塑料载带技术规范
- T/GDMDMA 0050-2025射频美容设备
- 【中小学】【学法指导】自习课主题班会-你真的会上自习课?【课件】
- 合租家具损坏赔偿协议范本二篇
- 重庆市城市建设发展有限公司招聘笔试题库2026
- 2026护理核心制度培训完整版
- DB21∕T 4374-2025 林业经营数表
- 心衰患者的监测指标解读
- 2026年天津市静海区初一地理上册月考考试试卷及答案
- 医疗费用知情同意书范本及注意点
- 四年级上册语文1-27课必背知识
- 2026国网江苏省电力公司高校毕业生提前批招聘笔试参考题库浓缩500题附答案详解(考试直接用)
- GB/T 222-2025钢及合金成品化学成分允许偏差
评论
0/150
提交评论