Languages

Menu
Sites
Language
앱 개발시 풀스크린, 전체화면이 적용되지않는 것에 대해서 질문드립니다.

안녕하세요

여러 오픈 소스를 참조하여 예제 앱을 만들어 보고잇는데

 

전체화면이 적용되지않고 실행화면 아래부분에 검은색 부분이 생겨서

해결이 되지않아 질문드립니다.

 

현재 index.html 소스 코드부분중에

        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">

참조한 오픈소스가 아마 요렇게 구성되어잇어 적용이 되지않는것 같은데

어떻게 수정을 통해 전체화면이 실행될수 있을까요?

Responses

1 Replies
Nafisul Islam Kiron

Hello, from what I can understand from your question is you want to run your app in full screen (which is running in half of your screen and other half is blank).

You can use:

<script>
   function toggleFullScreenHandler(e, target) 
   {
      var target = document.getElementById(target);
      /* Check whether in fullscreen mode */
      if (document.webkitIsFullScreen) 
      { 
         /* Cancel the fullscreen mode */
         document.webkitCancelFullScreen(); 
      } 
      else 
      {
         /* Switch on the fullscreen mode */
         target.webkitRequestFullScreen(); 
      }
   }
    
   document.getElementById('toggleImage').addEventListener('click', function(e) 
   {
      toggleFullScreenHandler(e, 'fs-image')
   }, false);
    
   document.getElementById('toggleVideo').addEventListener('click', function(e) 
   {
      toggleFullScreenHandler(e, 'video')
   }, false);
    
   document.addEventListener('click', function(e) 
   {
      toggleFullScreenHandler(e)
   }, false);
</script>
<style>
   #fs-image: -webkit-full-screen 
   {
      background: #39c;
   }
   #fs-image: full-screen 
   {
      background: #39c;
   }
</style>
<div class="my-class">
   <div id='fs-image'>
      <img src="images/logo.png" alt="LOGO">
      <p id="log"></p>
      <p><button id="toggleImage">Toggle Image fullscreen</button></p>
   </div>
   <div>
      <video id="video" controls preload="none" 
             poster="http://media.w3.org/2010/05/sintel/poster.png">
         <source id="mp4" src="http://media.w3.org/2010/05/sintel/trailer.mp4" 
                 type="video/mp4">
      </video>
   </div>
   <button id="toggleVideo">Toggle Video fullscreen</button>
</div>

 

From here:

https://developer.tizen.org/development/tutorials/web-application/w3chtml5supplementary-features/supplementary-features/fullscreen-api-mozilla