2013-08-23 9 views

답변

4

:보기를 가정

가장 쉬운은 iframe이 자신을 #render 방법을 무시하고 추가 아마, SC.View에서 확장 SproutCore보기 SC.WebView:desktop 프레임 워크에서이 작업을 수행합니다. src이 변경되거나 내용의 크기와 일치하도록 iframe의 크기를 조정하려는 경우 SC.WebView을 사용해야합니다. 예를 들어

,

myWebView: SC.WebView.extend({ 
    layout: { left: 10, right: 10, top: 10, bottom: 10, border: 1 }, 
    shouldAutoResize: true, // when the iframe loads, resize it to fit the size of its content 
    valueBinding: SC.Binding.oneWay('MyApp.currentUrl') // bind the 'src' of the iframe 
}) 
+0

(사이드 노트 : 나는 shouldAutoResize 속성은 동일 출처의 내용에 작동합니다 가정 내가 그렇게 최악의 당신이있어 비록 크기가 조절 출처 간 경우 정상적으로 실패 믿습니다. 안전한.) – Dave

1

몇 가지 방법이 있습니다. 도있다, 당신은 render 기능을 사용하여 아주 쉽게 고정 iframe을 렌더링 할 수 있지만

MyApp.MyView = SC.View.extend({ 
    render: function(context) { 
    context.push("<iframe src='http://google.com' />"); 
    } 
});