Screen rotation want to be fixed


#1

i want to fix screen orientation in only one page of my application ? is there any way ?Scroll view is not working gud? is any other option ?


#2

Hi, do you mean something like this https://www.npmjs.com/package/nativescript-screen-orientation?


#3

is this for all pages ?
i need to set only one page orientation … is it possible ?


#4

Yes, it is possible to set it just for one page. I am using it that way. You can try the examples on that link.


#5

after installing the plugin ,i didt see any change to my code…
constructor(page:Page){
page.on(“navigatedTo”,function(){
setCurrentOrientation(“portrait”,function(){
console.log(“portrait orientation”);
});
});
page.on(“navigatingFrom”,function(){
orientationCleanup();
});
});
}
i use this to my page…no error…but nothing will changed


#6

Do the console.logs fire?


#7

yup…i try to console.log(“landscape”) and also try alert message…but nothing will display ? no changes


#8

have you tried calling setCurrentOrientation directly from the constructor, not inside the page navigation events?


#9

yes…now i solve the issue…now i am able to set orientation…thank you for your help.