2012-11-29 3 views
1

아래와 같은 뷰가 있는데 콘텐츠 뷰에 ​​동적으로 뷰를 많이 추가하고 있으며 스크롤바가 보이지 않는 문제가 있습니다. 그래서 조금 아래로 뚫고 나는 동적으로 뷰를 추가 한 후 컨텐츠의 높이가 업데이트되지 않는 것을 발견했습니다.OpenLaszlo 스크롤링 문제

여기서 내가 뭘 잘못하고 있니? SWF 테스트 브라우저 : 파이어 폭스, 윈도우 XP 구성 요소가 i가 0

런타임에 contentwrapper의 폭과 높이를 설정하고 초기화 할 때 동일한 코드가 오픈 라즐로 3.3

<view name="wrapper"> 
<view name="scrollablecontainer" 
        width="${this.contentwrapper.width &gt; parent.width 
         ? this.contentwrapper.width : parent.width}" 
        height="${this.contentwrapper.height &gt; parent.height 
          ? this.contentwrapper.height : parent.height}"> 
       <view name="contentwrapper" > 
        <view name="contents"/> 
       </view> 
    </view> 
<vscrollbarnew name="vscroll" 
         height="${this.height}" 
         pagesize="${this.height}" 
         visible="${this.scrollable}"/> 
</view> 

에서 제대로 작동하는 것은 내가 한 가지를 놓쳤다

답변

1

구조가 매우 복잡해 보입니다. 왜 당신은 콘텐츠 래퍼와 콘텐츠 뷰를 가지고 있습니까? OpenLaszlo 3.4 (swf7 및 swf8)와 OpenLaszlo 5.0 trunk (SWF10 및 DHTML) 모두에서 컴파일하는 예제를 만들었습니다. wrapper 뷰에서 클리핑을 true로 설정하고 동적으로 생성 된 뷰가 추가 될 뷰 scrollablecontainer에 레이아웃을 추가했습니다.

<canvas height="400"> 

    <attribute name="counter" type="number" value="0" /> 

    <class name="rectangle" width="200" height="30" bgcolor="blue"> 
     <text name="label" align="center" valign="middle" /> 
    </class> 

    <!-- Wrapping view needs to have a width and height set and clip set to true --> 
    <view name="wrapper" x="100" y="10" 
      width="236" height="150" 
      bgcolor="#ff9999" 
      clip="true"> 

     <view x="10" name="scrollablecontainer" 
       bgcolor="#aaaaaa"> 

      <simplelayout axis="y" spacing="8" /> 

     </view> 

     <vscrollbar name="vscroll" 
        visible="${this.scrollable}"/> 
    </view> 

    <method name="addView"> 
     var v = null; 
     if ($swf7 || $swf8) { 
      v = new rectangle(canvas.wrapper.scrollablecontainer); 
     } else { 
      v = new lz.rectangle(canvas.wrapper.scrollablecontainer); 
     } 
     canvas.counter++; 
     v.label.setAttribute('text', 'View #' + canvas.counter); 
    </method> 

    <view> 
     <checkbox value="true" onvalue="canvas.wrapper.setAttribute('clip', this.value)" /> 
     <text x="20" >Clipping of view 'wrapper'</text> 
    </view> 

    <button y="25" text="Add view" onclick="canvas.addView()" /> 

</canvas> 

wrapper라는 뷰가 가능하고, 폭과 높이에 대한 설정 값을 가질 필요가있다 클리핑한다. 확인란을 클릭하면 래퍼에 대한 clip 속성의 값을 전환하여 효과를 볼 수 있습니다. 여기

앱은 오픈 라즐로 5.0 트렁크 SWF10에서 실행중인 : 여기 OpenLaszlo scrollbar and dynamic view generation

그리고 같은 코드는 오픈 라즐로 3.4 SWF8에서 실행 : enter image description here