Languages

Menu
Sites
Language
screen orientation

Hi

 

How to set fixed screen orientation for native app? I'd like only portrait mode.

I can't find any tags in tizen-manifest.xml.

 

slaw

 

Responses

2 Replies
Mango Bar

The following code has  four orientation value in array. You need to rearrange these four values according to your requirements.These four value works according to array index position. If you want to use portrait mode only, then keep 0 in the first position and after that set last parameter 1 of  elm_win_wm_rotation_available_rotations_set 

 If you want to keep only one orientation,then last parameter will be 1 instead of 4.For two orientation, value will be 2 and so on.

if (elm_win_wm_rotation_supported_get(ad->win)) 
{
    // Place your desired orientation value in array's first position. 0 is the portrait mode value
    int rots[4] = { 0, 90, 180, 270 };   

    elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 1); 

}

 

Slawek Kowalski

Thanks Mango. It works as you said.