FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
09/15/15 05:01 AM (8 years ago)

Stopping app from turning landscape

hi guys, prob been answered before but i have looked and there seams to be fixes for diff ios versions, ive tried ticking only the portrait and upside down tabs in xcode, but my app can still be viewed in landscape, which isn't good on some screens, how can i make the app only work in portrait and upside down and also can this be done in android. Thanks Sean
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/15/15 05:08 AM (8 years ago)
Hey there... Android is easy. In your AndroidManifest.xml file just add: android:screenOrientation="portrait" To the two Activity entries, like.... <activity android:name="YOUR_PACKAGE_NAME.BT_activity_start" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation|screenSize" android:screenOrientation="portrait" android:theme="@style/startThemeNoTitle" android:screenOrientation="portrait"> Add the android:screenOrientation="portrait" to the BT_activity_start and the BT_activity_host entries in the manifest, that will force Android to landscape. For iOS, as you mentioned, a TON of things have changed. If you're ticking things in Xcode you may have changed how it "should" work. As in, the BT_config.txt file allows you to make this change. Which, of course is editable in your BT control panel. The "allowRotation" key accepts a few different values. It's pretty reliable (unless you've changed something in Xcode) on iPhone. iPad will always rotate, no easy ay to prevent that. Like you said, lots to consider in iOS for the ole' rotation thing.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
09/15/15 05:19 AM (8 years ago)
Thanks David for the quick response, so what your saying is there's no complete way to stop it rotating in xcode. Thanks Sean i only need it stay in portrait update: changed the values in the appdelegate.m file to not allow rotation and it worked
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.