For the complete documentation index, see llms.txt. This page is also available as Markdown.

화면 속성


1. 화면 방향 설정하기 (setDeviceOrientation)

기기의 화면 방향을 가로 또는 세로로 설정해요. 특정 화면에서만 방향을 바꿔야 한다면, 화면을 벗어날 때 반드시 원래 방향으로 복구해 주세요.

시그니처

function setDeviceOrientation(options: { type: 'portrait' | 'landscape' }): Promise<void>;

파라미터

  • options.type · 필수 · 'portrait' | 'landscape'

    화면 방향을 지정해요. portrait은 세로 모드, landscape는 가로 모드예요.

예제

import { setDeviceOrientation } from '@apps-in-toss/web-framework';

setDeviceOrientation({ type: 'landscape' });
import { setDeviceOrientation } from '@apps-in-toss/web-framework';
import { useEffect } from 'react';

function VideoScreen() {
  useEffect(() => {
    setDeviceOrientation({ type: 'landscape' });

    return () => {
      setDeviceOrientation({ type: 'portrait' }); // 화면을 벗어날 때 복구해요.
    };
  }, []);
}
import { setDeviceOrientation } from '@apps-in-toss/framework';
import { useEffect } from 'react';

function VideoScreen() {
  useEffect(() => {
    setDeviceOrientation({ type: 'landscape' });

    return () => {
      setDeviceOrientation({ type: 'portrait' }); // 화면을 벗어날 때 복구해요.
    };
  }, []);
}

2. 화면 항상 켜짐 설정하기 (setScreenAwakeMode)

화면이 자동으로 꺼지지 않도록 설정해요. 웹툰, 동영상, 문서 읽기처럼 화면을 계속 켜둬야 하는 상황에서 유용해요. 특정 화면에서만 사용할 경우, 화면을 벗어날 때 반드시 비활성화해 주세요.

시그니처

function setScreenAwakeMode(options: { enabled: boolean }): Promise<{ enabled: boolean }>;

파라미터

  • options.enabled · 필수 · boolean

    true로 설정하면 화면이 꺼지지 않고, false로 설정하면 기본 화면 보호기 시간에 따라 꺼져요.

예제


3. 화면 캡처 차단하기 (setSecureScreen)

네이티브 수준에서 화면 캡처를 차단해요. 계좌 잔고, 거래 내역 등 민감한 정보를 표시하는 화면에서 활용할 수 있어요.

시그니처

파라미터

  • options.enabled · 필수 · boolean

    true면 화면 캡처를 차단하고, false면 허용해요.

예제

마지막 업데이트

도움이 되었나요?