주요 콘텐츠로 건너뛰기
Back to 플러그인
@capgo/capacitor-__스크린__위치__설정
튜토리얼
@capgo/capacitor-__스크린__위치__설정

__스크린__위치__설정__

__스크린__위치__설정__ 플러그인은 __위치__ 잠금을 우회하는 데 필요한 지원을 제공합니다.

가이드

화면 방향에 대한 튜토리얼

장치에서 테스트

다운로드 Capgo 앱, 그리고 QR code를 스캔하세요.

스크린 방향 플러그인 미리보기 QR code

@capgo/capacitor-스크린-방향 사용하기

Capacitor 스크린 방향 플러그인 인터페이스.

설치

bun add @capgo/capacitor-screen-orientation
bunx cap sync

이 플러그인이 제공하는 것

  • orientation - 현재 스크린 방향 가져오기.
  • lock - 특정 방향으로 스크린 방향 잠금.
  • unlock - 스크린 방향 잠금 해제.
  • startOrientationTracking - 장치 방향 추적 시작.

예시 사용

orientation

현재 스크린 방향 가져오기.

import { ScreenOrientation } from '@capgo/capacitor-screen-orientation';

const result = await ScreenOrientation.orientation();
console.log('Current orientation:', result.type);

lock

화면 방향을 특정 유형으로 고정하세요.

import { ScreenOrientation } from '@capgo/capacitor-screen-orientation';

// Standard lock
await ScreenOrientation.lock({ orientation: 'landscape' });

// Lock with motion tracking on iOS
await ScreenOrientation.lock({
  orientation: 'portrait',
  bypassOrientationLock: true
});

unlock

화면 방향을 해제하세요.

import { ScreenOrientation } from '@capgo/capacitor-screen-orientation';

await ScreenOrientation.unlock();

startOrientationTracking

운동 센서를 사용하여 장치 방향을 추적하세요.

import { ScreenOrientation } from '@capgo/capacitor-screen-orientation';

await ScreenOrientation.startOrientationTracking({
  bypassOrientationLock: true
});

// Listen for changes
ScreenOrientation.addListener('screenOrientationChange', (result) => {
  console.log('Orientation changed:', result.type);
});

전체 참조

Using @capgo/capacitor-화면-방향

이 기능을 사용하는 경우 Using @capgo/capacitor-화면-방향 자연/native 미디어 및 인터페이스 동작을 계획하려면 @capgo/capacitor-화면-방향 implementation detail in @capgo/capacitor-screen-orientation에 대한 Getting Started implementation detail in Getting Started에 대한 Using @capgo/capacitor-live-activities native capability in Using @capgo/capacitor-live-activities에 대한 @capgo/capacitor-live-activities implementation detail in @capgo/capacitor-live-activities 및 Using @capgo/capacitor-video-player native capability in Using @capgo/capacitor-video-player에 대한