다음을 통해 공유


애플리케이션에서 화면 방향 설정

Azure Communication Services UI 라이브러리를 사용하면 개발자가 애플리케이션에서 화면 방향을 설정할 수 있습니다. 통화 설정 화면과 UI 라이브러리의 통화 화면에서 화면 방향 모드를 지정할 수 있습니다.

필수 조건

화면 방향 설정

자세한 내용은 오픈 소스 Android UI 라이브러리샘플 애플리케이션 코드를 참조 하세요.

사용 가능한 방향

다음 표에서는 기본 방향에 대한 CallCompositeSupportedScreenOrientation 형식을 나열합니다. 복합 구성 요소의 다양한 화면 방향을 설정하려면 CallCompositeSupportedScreenOrientationCallComposite로 설정합니다.

방향 모드 CallCompositeSupportedScreenOrientation 형식
PORTRAIT CallCompositeSupportedScreenOrientation.PORTRAIT
LANDSCAPE CallCompositeSupportedScreenOrientation.LANDSCAPE
REVERSE_LANDSCAPE CallCompositeSupportedScreenOrientation.REVERSE_LANDSCAPE
USER_LANDSCAPE CallCompositeSupportedScreenOrientation.USER_LANDSCAPE
FULL_SENSOR CallCompositeSupportedScreenOrientation.FULL_SENSOR
USER CallCompositeSupportedScreenOrientation.USER

방향 API

CallCompositeSupportedScreenOrientation은 Android UI 라이브러리에 대한 사용자 지정 형식입니다. 방향 형식의 이름은 Android 플랫폼의 방향 모드 이름과 유사성을 유지하여 정의됩니다.

기본적으로 설정 화면 방향은 PORTRAIT 모드이고 호출 화면은 USER 모드입니다. 화면에 대해 다른 방향을 설정하려면 CallCompositeSupportedScreenOrientation을 전달할 수 있습니다. UI 라이브러리에는 복합 구성 요소와 함께 사용할 수 있는 CallCompositeSupportedScreenOrientation 형식 집합이 포함되어 있습니다.

정적 함수 CallCompositeSupportedScreenOrientation를 사용하여 CallCompositeSupportedScreenOrientation.values() 형식의 목록을 가져올 수도 있습니다.

방향을 설정하려면 CallCompositeSupportedScreenOrientation을 지정하고 CallCompositeBuilder에 전달합니다. 다음 예제에서는 설정 화면에 대해 FULL_SENSOR 및 복합 구성 요소의 호출 화면에 대해 LANDSCAPE를 설정합니다.

import com.azure.android.communication.ui.calling.models.CallCompositeSupportedScreenOrientation

// CallCompositeSupportedLocale provides a list of supported locales
val callComposite: CallComposite =
            CallCompositeBuilder()
            .setupScreenOrientation(CallCompositeSupportedScreenOrientation.FULL_SENSOR)
            .callScreenOrientation(CallCompositeSupportedScreenOrientation.LANDSCAPE)
            .build()

자세한 내용은 오픈 소스 iOS UI 라이브러리샘플 애플리케이션 코드를 참조하세요.

사용 가능한 방향

다음 표에서는 기본 방향에 대한 OrientationOptions 형식을 나열합니다. 복합 구성 요소의 다양한 화면 방향을 설정하려면 OrientationOptionsCallComposite로 설정합니다.

방향 모드 OrientationOptions 형식
portrait OrientationOptions.portrait
landscape OrientationOptions.landscape
landscapeRight OrientationOptions.landscapeRight
landscapeLeft OrientationOptions.landscapeLeft
allButUpsideDown OrientationOptions.allButUpsideDown

방향 API

OrientationOptions은 iOS UI 라이브러리에 대한 사용자 지정 형식입니다. 방향 형식의 이름은 iOS 플랫폼의 방향 모드 이름과 유사성을 유지하여 정의됩니다.

기본적으로 설정 화면 방향은 portrait 모드이고 호출 화면은 allButUpsideDown 모드입니다. 화면에 대해 다른 방향을 설정하려면 OrientationOptions을 전달할 수 있습니다. UI 라이브러리에는 복합 구성 요소와 함께 사용할 수 있는 OrientationOptions 형식 집합이 포함되어 있습니다.


let callCompositeOptions = CallCompositeOptions(localization: localizationConfig,
                                                setupScreenOrientation: OrientationOptions.portrait,
                                                callingScreenOrientation: OrientationOptions.allButUpsideDown)
let callComposite = CallComposite(withOptions: callCompositeOptions)

다음 단계