Actionscript 3 如何最大化spark.components.Callout?附上截图
如何最大限度地利用屏幕上的最大可用空间 我正在尝试,当它工作时,显示的Actionscript 3 如何最大化spark.components.Callout?附上截图,actionscript-3,apache-flex,flex4,flex4.6,callout,Actionscript 3,Apache Flex,Flex4,Flex4.6,Callout,如何最大限度地利用屏幕上的最大可用空间 我正在尝试,当它工作时,显示的视图太窄: 在同一个程序中,我有另一个标注,它足够宽: 它们之间唯一的两个区别是后者连接到a,后者持有一个自定义的分数组件,我为其设置了: override protected function measure():void { super.measure(); measuredWidth = Capabilities.screenResolutionX; measu
视图
太窄:
在同一个程序中,我有另一个标注
,它足够宽:
它们之间唯一的两个区别是后者连接到a,后者持有一个自定义的分数组件,我为其设置了:
override protected function measure():void {
super.measure();
measuredWidth = Capabilities.screenResolutionX;
measuredHeight = Capabilities.screenResolutionY;
}
我一直盯着代码看,但找不到一种方法来欺骗它以占据大部分可用空间
我的自定义mxml组件非常简单:
PlayerInfo.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:Callout
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
contentBackgroundAppearance="none">
<fx:Script>
<![CDATA[
[Bindable]
public var userid:String;
]]>
</fx:Script>
<s:ViewNavigator
firstView="views.Profile"
firstViewData="{userid}">
<s:navigationContent>
<s:Button label="Close" click="close()" />
</s:navigationContent>
</s:ViewNavigator>
</s:Callout>
Callout扩展了容器,因此将宽度和高度设置为100%应该不会有问题。
此外,在标注代码中还有一个方法:
/**
* @private
* Force a new measurement when callout should use it's screen-constrained
* max size.
*/
private function invalidateMaxSize():void
{
// calloutMaxWidth and calloutMaxHeight don't invalidate
// explicitMaxWidth or explicitMaxHeight. If callout's max size changes
// and explicit max sizes aren't set, then invalidate size here so that
// callout's max size is applied.
if (!canSkipMeasurement() && !isMaxSizeSet)
skin.invalidateSize();
}
因此,请尝试设置“explicitMaxWidth”和“explicitMaxHeight”属性。Callout扩展了容器,因此将宽度和高度设置为100%应该不会有问题。
此外,在标注代码中还有一个方法:
/**
* @private
* Force a new measurement when callout should use it's screen-constrained
* max size.
*/
private function invalidateMaxSize():void
{
// calloutMaxWidth and calloutMaxHeight don't invalidate
// explicitMaxWidth or explicitMaxHeight. If callout's max size changes
// and explicit max sizes aren't set, then invalidate size here so that
// callout's max size is applied.
if (!canSkipMeasurement() && !isMaxSizeSet)
skin.invalidateSize();
}
因此,尝试设置“explicitMaxWidth”和“explicitMaxHeight”属性。实际上,我尝试在Callout
和/或ViewNavigator
上设置width=“100%”和/或:覆盖受保护的函数measure():void{super.measure();measuredWidth=Capabilities.screenResolutionX;measuredHeight=Capabilities.screenResolution;}
实际上我试过设置width=“100%”
在Callout
和/或ViewNavigator
上,这不会改变任何内容。为s:Callout组件添加解决方案对我来说很有效(更新PlayerInfo.mxml文件):覆盖受保护的函数measure():void{super.measure();measuredWidth=Capabilities.screenResolutionX;measuredHeight=Capabilities.screenResolutionY;}