问题:
flex使用module加载swf,部分组件样式丢失(datefield RadioButton)
解决方法:
方案一.在Application主文件里面放入丢失样式的组件,并设置组件属性visible=false.
2.把CSS文件编译成SWF格式文件
右键CSS文件,将之编译成SWF格式文件。此时在webroot下就可以看到已经编译成相关的SWF文件
3.调用styleManager.loadStyleDeclarations()方法讲CSS的SWF文件加载进应用程序
如:StyleManager.loadStyleDeclarations('assets/css/mycss1.swf',true,false, ApplicationDomain.currentDomain)
第二个参数设置是是否立即更新样式,第四个参数是访问域的设置使已编译的应用程序或模块可以设置仅影响其自身和其子代的样式
ApplicationDomain.currentDomain为当前应用程序下都可以访问
4. 分模块下样式丢失的问题
(1) 可以在每次加载模块前设置该模块应用父模块相同的moduleFactor
this.moduleFactory=FlexGlobals.topLevelApplication.moduleFactory ;
方案二.在flex编译属性配置文件(.actionScriptProperties)编译参数中加上-keep-all-type-selectors=true -isolate-styles=false。如下配置:
<compiler additionalCompilerArguments="-services "x:/workspace/xxx/WebRoot/WEB-INF/flex/services-config.xml"[color=red] -keep-all-type-selectors=true -isolate-styles=false[/color] -allow-source-path-overlap=true -source-path=com/cist/gis/config -locale zh_CN" autoRSLOrdering="true" copyDependentFiles="true" flex3CompatMode="false" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="WebRoot" removeUnusedRSL="true" rootURL="http://localhost:8080/xxx" sourceFolderPath="flex_src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
flex使用module加载swf,部分组件样式丢失(datefield RadioButton)
解决方法:
方案一.在Application主文件里面放入丢失样式的组件,并设置组件属性visible=false.
2.把CSS文件编译成SWF格式文件
右键CSS文件,将之编译成SWF格式文件。此时在webroot下就可以看到已经编译成相关的SWF文件
3.调用styleManager.loadStyleDeclarations()方法讲CSS的SWF文件加载进应用程序
如:StyleManager.loadStyleDeclarations('assets/css/mycss1.swf',true,false, ApplicationDomain.currentDomain)
第二个参数设置是是否立即更新样式,第四个参数是访问域的设置使已编译的应用程序或模块可以设置仅影响其自身和其子代的样式
ApplicationDomain.currentDomain为当前应用程序下都可以访问
4. 分模块下样式丢失的问题
(1) 可以在每次加载模块前设置该模块应用父模块相同的moduleFactor
this.moduleFactory=FlexGlobals.topLevelApplication.moduleFactory ;
方案二.在flex编译属性配置文件(.actionScriptProperties)编译参数中加上-keep-all-type-selectors=true -isolate-styles=false。如下配置:
<compiler additionalCompilerArguments="-services "x:/workspace/xxx/WebRoot/WEB-INF/flex/services-config.xml"[color=red] -keep-all-type-selectors=true -isolate-styles=false[/color] -allow-source-path-overlap=true -source-path=com/cist/gis/config -locale zh_CN" autoRSLOrdering="true" copyDependentFiles="true" flex3CompatMode="false" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="WebRoot" removeUnusedRSL="true" rootURL="http://localhost:8080/xxx" sourceFolderPath="flex_src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">