2012-12-05 2 views
1

Callout을 최대화하는 방법으로 화면에서 최대한의 공간을 차지합니까?spark.components.Callout을 극대화하는 방법? 스크린 샷이 첨부 됨

내가 to display a ViewNavigator in a Callout을 시도하고 그것이 작동하는 동안, 표시 View이 너무 좁 :

enter image description here

같은 프로그램에서 나는 또 다른 Callout을 가지고 있고 그것은 충분히 넓다 :

enter image description here

그들 사이의 유일한 차이점은 후자가 CalloutButton에 붙어 있고 후자는 톰 Score 구성 요소가있는 I 설정 : 나는 Callout.as 코드를보고 계속하지만, 아직 대부분의 사용 가능한 공간을 차지을 속일 수있는 방법을 찾을 수 없습니다

override protected function measure():void { 
     super.measure(); 
     measuredWidth = Capabilities.screenResolutionX; 
     measuredHeight = Capabilities.screenResolutionY; 
    } 

.

내 사용자 정의 MXML 구성 요소는 매우 간단합니다 :

PlayerInfo.mxml : 당신이 100 % 너비와 높이를 설정 문제가해서는 안 콜 아웃은 컨테이너를 확장

<?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>   

답변

1

.

/** 
* @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'속성을 설정하려고 :
또한, 콜 아웃 코드에서하는 방법이있다.

+0

사실 나는''Callout' 및/또는''ViewNavigator''에'width = "100 %"'설정을 시도했지만 아무 것도 바뀌지 않습니다. –

+1

s에 대한 해결 방법을 추가하십시오 : 콜 아웃 구성 요소가 저에게 효과적이었습니다 (PlayerInfo.mxml 파일 업데이트) : override protected function measure() : void { super.measure(); measuredWidth = Capabilities.screenResolutionX; measuredHeight = Capabilities.screenResolutionY; }' – alekseyk

관련 문제