簡體   English   中英

禁用在iPhone Web應用程序中移動但保留滾動?

[英]Disable moving in an iPhone web application but leave scrolling?

要禁用本機tochemove事件通常需要使用:

document.body.addEventListener('touchmove', function(e){ e.preventDefault(); });

但是如果想要阻止移動窗口(屏幕邊框)但是保留滾動頁面內容的功能呢?

使用UIWebView以下代碼可能會幫助您 -

 UIWebView *webView = ...
//set zoom
UIScrollView *scrollView = [webView.subviews objectAtIndex:0];
[scrollView setZoomScale:0.0 animated:YES];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM