2016-06-19 3 views
0

마지막으로 UIWebView에서 내 vimeo 비디오를 보여줄 수있었습니다. 있는 UIWebView의 크기는 280 = W, H = 204Vimeo 비디오가 UIWebView에 적합하지 않음, swift

이 비디오가있는 UIWebView에 장착하는 방법입니다

enter image description here

을 그리고 내가 그 자리에 비디오를 드래그 할 수 있습니다 어디에서 보기가로드 될 때 처음부터 싶습니다 :

:

enter image description here

이 내가 비디오를 보여주기 위해 사용하고있는 코드입니다

let embedHTML="<html><head><style type=\"text/css\">body {background-color: transparent;color: white;}</style></head><body style=\"margin:0\"><iframe src=\"//player.vimeo.com/video/171151492?autoplay=1&amp;loop=1\" width=\"280\" height=\"204\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"; 

webView.delegate = self 
let url: NSURL = NSURL(string: "https://player.vimeo.com/video/171151492")! 
webView.loadHTMLString(embedHTML as String, baseURL:url) 

답변

1

보기 컨트롤러가 UIWebView의 스크롤보기 인세 트를 탐색 모음에 맞게 조정하려고합니다.

아래이를 방지하기 위해 false로보기 컨트롤러의 automaticallyAdjustsScrollViewInsets 속성을 설정할 수 있습니다 :

self.automaticallyAdjustsScrollViewInsets = false 

또는 인터페이스 빌더에서

, 레이아웃 섹션에서보기 컨트롤러의 "스크롤보기 삽입 된 조정"을 옵션을 선택 취소.

+0

사랑해, 고마워. –

관련 문제