flex的Canvas可以和HTML的DIV一样做块状的网格布局
用到的MX标签:constraintColumns、ConstraintColumn、constraintRows、ConstraintRow
给大家说说前提情况:在做MXML布局时,要嵌套很多层级,这里面有很多问题:
1、嵌套太多层级会影响效率!
2、嵌套太多层级,代码的可读性、可维护性差!
3、嵌套太多层级是因为Canvas、Vbox、Hbox功能单一,不能满足需要,而不是必须要这样做。
好吧,来看一个MXML代码示例:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
<mx:constraintColumns>
<mx:ConstraintColumn id="column1" width="250"/>
<mx:ConstraintColumn id="column2" width="100%"/>
</mx:constraintColumns>
<mx:constraintRows>
<mx:ConstraintRow id="row1" height="25"/>
<mx:ConstraintRow id="row2" height="25"/>
<mx:ConstraintRow id="row3" height="100%"/>
<mx:ConstraintRow id="row4" height="35"/>
</mx:constraintRows>
<mx:Button id="topMenuCvs" label="topMenuCvs" width="100%"
top="row1:0" bottom="row1:0"/>
<mx:Button id="topButtonCvs" label="topButtonCvs" width="100%"
top="row2:0" bottom="row2:0"/>
<mx:Button id="leftNavCvs" label="leftNavCvs" height="100%"
top="row3:0" bottom="row3:0" left="column1:0" right="column1:0"/>
<mx:Button id="leftMainCvs" label="leftMainCvs" height="100%"
top="row3:0" bottom="row3:0" left="column2:0" right="column2:0"/>
<mx:Button id="footCvs" label="footCvs" width="100%"
top="row4:0" bottom="row4:0"/>
</mx:Application>
效果图:
相关文档:
/*Copyright (c) 2006 Adobe Systems Incorporated
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, m ......
Crescent Eve(http://www.kashim.com/eve/
)是免费的HTML,CSS的编辑器.
和记事本类似,非常简洁.
主要有以下4个功能
HTML的tag输入提示
tag属性的输入提示
HTML的语法检查
HTML预览
在编辑HTML画面时非常有用.
Crescent Eve是非常小的一个编辑器,操作也非常简 ......
String userId = request.getParameter("userId");
System.out.println(userId);
response.setCharacterEncoding("UTF-8");
//response.getWriter().println("hello world -- 我爱你。。。");
String xml = "<user>" +
"<username>涛哥</username>" +
"</user>";
respon ......
url:http://www.w3cschool.cn/tag_tbody.asp.htm
<tbody> 标签表格主体(正文)。该标签用于组合 HTML 表格的主体内容。
tbody 元素应该与 thead 和 tfoot 元素结合起来使用。
thead 元素用于对 HTML 表格中的表头内容进行分组,而 tfoot 元素用于对 HTML 表格中的表注(页脚)内容进行分组。
thead、tf ......
<%@ page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*" %>
<%
//在这里如果写成“WEB-INF\templates\template.htm”程序会报错
String filePath = request.getRealPath("/")+"WEB-INF/templates/template.htm"; &nbs ......