flex 滚动条问题
flex滚动条虽然很好用,但总是会出现意想不到的问题。前几天说了,拖动后花屏的问题,今天又发现了更恶心的问题。当你把容器的宽度调为100%后 ,verticalScrollbarPolicy 用默认的auto。这是如果你缩放窗口会出现滚动条,但问题这是就出现了,只要出现了垂直滚动条,水平滚动条就是被迫出现。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
<mx:Canvas width="100%" height="700"/>
</mx:Application>
这是是由于flex在计算前面的百分比时,把垂直滚动条的宽度也算上了,我一开始以为是flex的bug。使其他的官方文档中写了一句很华丽的话。
"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 height property 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."
-- from Sizing Components in the Flex 3 help, under "Using Scroll bars"
就这样回避了这个问题。但有个办法你可以解决这个问题,重载validateSize方法
// In your Application ,module or wherever you need this workaround.
override public function validateSize(recursive:Boolean = false):void {
super.validateSize(recursive);
if (!initialized) return;
if (height < measuredHeight) verticalScrollPolicy = ScrollPolicy.ON;
else verticalScrollPolicy = ScrollPolicy.OFF;
}
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
function chkbox():void
{
var menssage:String = "";
if (c ......
PopUpEffect.as
package
{
import flash.display.DisplayObject;
import mx.core.IFlexDisplayObject;
import mx.effects.Blur;
import mx.events.TweenEvent;
import mx.managers.PopUpManager;
public class PopUpEffect
{
public function PopUpE ......
1. 整体的结构分布:
各模块使用Module来划分,每个模块的页面及其相关的组件元素都是使用Component来划分;
模块的切换使用加载的方式,模块内部的切换使用页面跳转的方式;
技术问题:模块的切换与页面的切换的过程!
ModuleLoader与ModuleManager之间的取舍,选择了后者,可控的更多,但是目前的影响并不大!
关于M ......
第一种:修改下载进度的文字为中文
建立扩展至 mx.preloaders.DownloadProgressBar 的一个类:
01.package myDownPro
02.{
03.import mx.preloaders.DownloadProgressBar;
04.
05.public class myDownProBar extends DownloadProgressBar
06.{
07. public function myDownProBar()
08. {
09. //TODO: impl ......
前言:
本项目主要是通过把地图切片嵌入swf,把切片坐标用Java数据打包,然后 在Flex项目内通过Java读取打包数据,通讯给Flex,最后把swf内的图片安放在对应位置来实大地图 拆分->打包->再现的过程。
1. swf图片打包代码 BitMapClass.as
package
{
import flash.display.Sprite;
public class BitM ......