flex GRID绘制表格类似HTML的Table的简单实现
来源:互联网 发布:奢侈品价格查询软件 编辑:程序博客网 时间:2024/05/17 08:13
flex绘制表格用的是 grid 控件,可以实现像html的表格的样子,当然写法和html类似,只是名字不同:
grid——table
GridRow——tr
GridItem——td
效果如图所示:
直接复制就能运行。直接看代码很简单 不用解释:
CSS样式
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
mx|Grid
{
borderStyle: solid;
horizontalGap:-1;
verticalGap:-1;
paddingLeft:-1;
paddingTop:-1;
paddingRight:-1;
paddingBottom:-1;
}
mx|GridItem{
borderStyle: solid;
horizontalAlign: center;
verticalAlign: middle;
paddingTop:-1;
paddingBottom:-1;
}
主类:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Style source="cc.css"/>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
mx|Grid{
}
</fx:Style>
<s:Panel left="5" right="5" top="5" bottom="5">
<s:Button x="88" top="10" label="添加一行"/>
<s:Button left="10" top="10" label="开始抽题"/>
<s:BorderContainer left="10" right="10" top="39" bottom="30" cornerRadius="5">
<mx:Grid top="10" horizontalCenter="0">
<mx:GridRow width="100%" height="40" id="ijjj">
<mx:GridItem width="60">
<s:Label text="科目"/>
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="300" colSpan="2">
<s:Label text="请输入题目个数"/>
</mx:GridItem>
<mx:GridItem width="60">
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="40">
<mx:GridItem width="60" height="133" rowSpan="3">
<s:Label text="选题"/>
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="60">
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="40">
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="60">
</mx:GridItem>
</mx:GridRow>
<mx:GridRow width="100%" height="40">
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="150">
</mx:GridItem>
<mx:GridItem width="60">
</mx:GridItem>
</mx:GridRow>
</mx:Grid>
</s:BorderContainer>
</s:Panel>
</s:WindowedApplication>
- flex GRID绘制表格类似HTML的Table的简单实现
- Flex 用Grid实现类似于Html的细线表格
- 如何绘制一张简单的html表格
- Extjs4--简单的Grid表格
- Silverlight中使用Grid创建自定义的Table表格
- 介绍几个FLEX 第三方 的grid /table库
- 运用jsp简单实现 类似HTML框架结构的运用:
- 收藏! 表格(table) 高级的使用方法 (html)
- HTML表格标签的使用-<table>
- HTML 中表格table 的相关知识
- html的笔记(table表格)
- 关于html中的表格table的用法
- HTML中table表格的常用使用
- HTML页面自适应宽度的table(表格)
- html table表格导出excel的方法
- html 简单的table样式
- html一个简单的表格
- 在Flex中,如何实现类似html中图片热点链接的效果呢?
- qt异常错误退出
- 淘宝商城实习三月记:产品经理做什么
- 【数字图像处理】图像的gamma校正
- Win7下用wubi.exe安装ubuntu 双系统
- QT QTableWidget中实现整行选中和禁止编辑单元格
- flex GRID绘制表格类似HTML的Table的简单实现
- 『女大学生悲惨之夜后,她跟他居然上床!』
- Windows Phone 7之初体验(六.完整版模拟器)
- ubuntu下常用命令
- 好的网站
- 工作效率定律
- HTablePool 连接池源码分析
- [pythonchallenge]level6
- 一起学Windows phone 7开发(一.Application Bar)