모바일 » Api

getorientation

Description

모바일에서 현재 화면 방향을 얻어온다.

Parameters

Parameters Type Description
strCallBackName STRING 호출할 CallBack 함수명

Return Value

Type Description
void

Remark

시스템 정보를 JSON 형태로 리턴 받아 처리 할수 있다.

Example

function btn_getorientation_on_mouseup(objInst) { mobil_basic.getorientation("mobile_api_callback"); } // Callback Function function mobile_api_callback(func_name, response) { var html = ""; var obj = JSON.parse(response); mobil_basic.toast("func_name: " + func_name); mobil_basic.toast("response: " + response); if (obj.code != 200) { screen.alert(obj.result); return; } /** Info API **/ if (func_name == "getorientation") { html = "화면 방향 : " + GetOrientationText(obj.orientation) + " (" + obj.orientation + ")"; fld_sys.settext(html); } } function GetOrientationText(orientation) { orientation = parseInt(orientation, 10); switch(orientation) { case 1: return "Portrait"; case 2: return "Landscape"; } }

See Also

setorientation

Viewer Ver.

9.1.1.1

Update Date

20240125