Ricky D Well-Known Member Licensed User Longtime User Mar 17, 2012 #1 Ok, I now have my head sorted out with the dual layouts I will be using. Now I would like to know how do I detect what orientation the screen is in when certain bits of code get executed. I'd like to do something like Code: Copy If orientation="Potrait" Then TabHost1.AddTab("Page 1") TabHost1.AddTab("Page 2") Else If orientation="Landscape" Then Tabhost1.AddTab("Page 1") TabHost1.AddTab("Page 2") TabHost1.AddTab("Page 3") End If how do I detect what orientation is at any given moment? I've tried looking at Phone but no joy. Can anyone help? There will be a few places where I need to detect which way the screen is oriented. regards, Ricky
Ok, I now have my head sorted out with the dual layouts I will be using. Now I would like to know how do I detect what orientation the screen is in when certain bits of code get executed. I'd like to do something like Code: Copy If orientation="Potrait" Then TabHost1.AddTab("Page 1") TabHost1.AddTab("Page 2") Else If orientation="Landscape" Then Tabhost1.AddTab("Page 1") TabHost1.AddTab("Page 2") TabHost1.AddTab("Page 3") End If how do I detect what orientation is at any given moment? I've tried looking at Phone but no joy. Can anyone help? There will be a few places where I need to detect which way the screen is oriented. regards, Ricky
margret Well-Known Member Licensed User Longtime User Mar 17, 2012 #2 Code: Copy If activity.width > activity.height then 'Your in landscape Else 'Your in portrait End If Upvote 0
Ricky D Well-Known Member Licensed User Longtime User Mar 17, 2012 #3 :sign0142: Thanks Margret. regards, Ricky Upvote 0
A alexis Member Licensed User Longtime User Mar 26, 2012 #4 margret said: Code: Copy If activity.width > activity.height then 'Your in landscape Else 'Your in portrait End If Click to expand... thanks! Upvote 0
margret said: Code: Copy If activity.width > activity.height then 'Your in landscape Else 'Your in portrait End If Click to expand... thanks!