最近碰到一个问题: 当Flex右侧垂直滚动条出现时, 下方水平滚动条必定随之出现, 详细的描述就是:
该UIComponent高度一定, 宽度设置为percent(也就是说宽度可以变化), 当Add一个内部组件到该UI上后, UI需要更多高度, 但高度一定, 只好出现右侧滚动条(默认的ScrollPolicy为auto), 假使被增加组件的宽度与外部组件宽度一致, 此时由于滚动条的出现, 外部UI不能直接完整显示该组件, 于是出现水平滚动条,.
Flex API中有关内容: Sizing components http://livedocs.adobe.com/flex/3/html/help.html?content=size_position_3.html
Notice that the addition of the scroll bar doesn’t increase the height of the container from its initial value. Flex considers scroll bars in its sizing calculations only if you explicitly set the scroll policy to
ScrollPolicy.ON. So, if you use an auto scroll policy (the default), the scroll bar overlaps the buttons. To prevent this behavior, you can set the
heightproperty for the HBox container or allow the HBox container to resize by setting a percentage-based width. Remember that changing the height of the HBox container causes other components in your application to move and resize according to their own sizing rules.
解决方案比较清晰, 要么设置ScrollPoliocy为No, 要么调整宽高设置. 为了清晰演示, 写了个小Application:
PDF Link: http://goo.gl/ZKcj8 [Box.net]
prepared by: http://liguoliang.com/2011/visa
准备工作:
有顺序并应及时完成的工作:
1. 中信银行购买电话卡, 缴纳签证费用(只需要携带护照, ¥910) ①
2. 打电话预约面签(需提供姓名, 护照号码, 身份证号, 出生日期, 联系方式等信息, 大使馆网
站有公布各地面前预约排队情况, 文末有链接)
面签一般会约在若干天/若干周之后, 因此在面签之前的这段时间可准备:
3. 照片 (高手可自拍, 末尾有标准链接)
4. DS_160(https://ceac.state.gov/GENNIV/)的填写, 确认, 签署, 并打印确认页面;
面签材料必须材料:
1. 护照;
2. DS_160 确认页;
3. 中信签证费用收据;
可选材料: 员工卡/营业执照复印件/房产证/结婚证等.
面签过程:
1. 前往梅龙镇广场(南京西路1038 号, 电话预约及DS160 确认页上都有地址) ;
2. 梅陇镇广场附近先找地方存包, 参考价格: 小包10 块, 双肩20, 取包时付钱. 注意: 他们可
能会帮你检查资料, 不过不需理会他们, 可直接撤回梅陇镇广场. [领事馆严格遵守预约时间段允
许申请人进入等候室。请注意手袋、背包、移动电话、相机和其他任何电子设备概不允许带入领
事馆http://shanghai-ch.usembassy-china.org.cn/visas/visa-application-process.html]
3. 楼下拿牌号, 取EMS 快递单, 工作人员会撕掉一联交给你, 这一联是留给你的 自己放好就
ok;
4. 按照指示上楼排队.
5. 1~2 号窗口将 : 护照&确认页&收据&快递面单
6. 交完后等喊号, 喊到后3 号窗口领回刚才的资料, 他们会帮你装到一个透明文件夹中;
7. 4~5 号窗口采集指纹
8. 进入面签队伍, 等待面签.
9. 面签, 3~5 个工作日可收到. [譬如: 12.1 日面签, 12.2 日发货, 12.3 日收到]
面签提示:
1. 可及时出示公司的邀请函;
注意信息:
DS_160 中的信息请确认无误
DS_160 的编号请记录下来, 可随时通过该号码及确认问题retrieve 申请 — 即使签署之后还可
以根据旧有内容创建新申请.
备注:
①: 电话卡可网上购买: https://www.usavisainformation.com.cn/eng/welcome.aspx 梅陇镇广场
对面亦有”中信银行”网点. 因此如果时间紧迫或懒得折腾, 可网上购买电话卡预约(发票情况未
知), 在面签之前缴费拿到收据就好.
有用的链接:
1. 查看近期预约排队时间: http://chinese.usembassy-china.org.cn/niv_info2.html
2. 上海领事馆非移民签证指南[有详细指示及面签平面
图]: http://photos.state.gov/libraries/shanghai/504465/mccormackbp/One%20page%20instruct
ional%20guide%20Chinese.pdf
3. 照片详细要求及处理工具(自拍请参
考): http://travel.state.gov/visa/visaphotoreq/visaphotoreq_5334.html
4. 中信银行网点列表: http://bank.ecitic.com/personal/chuguo/50.htm, 电话: 95558
Requirement: We want to validate user input in editable datagrid, and revert the original value(undo) if necessary.
Solution: Handle the ‘itemEditEnd’ Event dispatched by the datagrid.
Codes:
/** * validate user input, revert the original value if necessary. */ protected function datagirdTest_itemEditEndHandler(event:DataGridEvent):void { if(event.dataField != "Name") { // chech the field; return; } var input:String = (datagirdTest.itemEditorInstance as TextInput).text; // get the user input data. if(input == null || input == "") { event.preventDefault(); // prevent default behavior // var filed:String = (datagirdTest.columns[event.columnIndex] as DataGridColumn).editorDataField; // trace(datagirdTest.itemEditorInstance[filed]); (datagirdTest.itemEditorInstance as TextInput).text = (event.itemRenderer.data as XML).Name;// Undo: revert the original data by the selected item. Alert.show(errorMesg); return; } }
Screen caputre:
User input is empty, we got the Event, prevent the default behavior, and revert the value form the modeling.
Ref:
1. itemEditEnd called multiple times http://forums.adobe.com/message/2459209
2. Using cell editing events – http://livedocs.adobe.com/flex/3/html/help.html?content=celleditor_7.html
琐碎寡味的一周。
跟以前一样,我仍旧在逃避着很多,尤其内心阴暗处的一滩又一滩的水,幻想有一天柳暗花明,风清云淡。
从暴躁到暴躁,从自私到自私,这两年,年复一年,一年不如一年。
未老莫还乡,还乡须断肠。如果生活还是那么简单,内心会是多么平静。
有多久,没有安静下来,有多久,没有用心生活,粗糙,愚钝。
睡觉,睡觉。
Command: dir/s/b > list.txt
Output:
D:\PatchScriptsForAppTest\35315_deltas.xnr D:\PatchScriptsForAppTest\35338_Part1_Translations.xnr D:\PatchScriptsForAppTest\35338_part2_XeAppMenus.xnr D:\PatchScriptsForAppTest\35345_Translations_IN_OUT.xnr
More info: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dir.mspx?
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.