모바일 » Api
eventorientation
Description
모바일의 화면 방향이 변경되었을때 이벤트를 지정합니다.
Parameters
Parameters |
Type |
Description |
strCallBackName |
STRING |
호출할 CallBack 함수명 |
Return Value
Remark
orientation: 화면 표시 상태 값
- 0: Invalid
- 1: portrait
- 2: landscape
- 99: Unknown
Example
function btn_eventorientation_on_mouseup(objInst)
{
mobil_basic.eventorientation("mobile_event_callback");
}
function mobile_event_callback(event_name, response) {
var obj = JSON.parse(response);
screen.alert("event_name :" + event_name );
if (obj.code != 200) {
screen.alert(obj.result);
return;
}
if (event_name == "orientation") {
fld_event_orientation.settext(GetOrientationText(obj.orientation) + " (" + obj.orientation + ")");
}
}
function GetOrientationText(orientation)
{
orientation = parseInt(orientation, 10);
switch(orientation) {
case 0: return "Invalid";
case 1: return "Portrait";
case 2: return "Landscape";
case 99: return "Unknown";
default: return "Unknown";
}
}
Viewer Ver.
9.1.1.1
Update Date
20190628