본문 바로가기
모바일 앱/React Native

[React Native] React Native Webview 줌(zoom) 비활성화하기

by 테크케찰 2021. 7. 29.

react-native-webview에서는 손가락 두 개를 이용해 내용을 zoom할 수 있습니다.

zoom을 비활성화하려면 html 태그 상단에 다음 문장을 추가해주면 됩니다.

<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0">

이를 적용한 모습은 아래와 같습니다,

<WebView 
	...
    source={{
    	html:`
        	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0">
			${html} //html 값이 여기 들어가면 됩니다. 
        `
    }}
    ...
/>

 

 

참고 

https://stackoverflow.com/a/48252727/15458307

 

Disable zoom on web-view react-native?

How to disable zoom on react-native web-view,is there a property like hasZoom={false}(just an example) that can be included in the below web-view tag that can disable zooming. It has to be working...

stackoverflow.com