Only ONE VIEW landscape mode

Swift AppDelegate.swift internal var shouldRotate = false func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { return shouldRotate ? .allButUpsideDown : .portrait } Your landscape view controller let appDelegate = UIApplication.shared.delegate as! AppDelegate appDelegate.shouldRotate = true // or false to disable rotation Objective-C AppDelegate.h @property (assign, nonatomic) BOOL shouldRotate; AppDelegate.m – (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow … Read more

Getting android.content.res.Resources$NotFoundException: exception even when the resource is present in android

For my condition the cause was taking int parameter for TextView. Let me show an example int i = 5; myTextView.setText(i); gets the error info above. This can be fixed by converting int to String like this myTextView.setText(String.valueOf(i)); As you write int, it expects a resource not the text that you are writing. So be … Read more

Force “portrait” orientation mode

Don’t apply the orientation to the application element, instead you should apply the attribute to the activity element, and you must also set configChanges as noted below. Example: <activity android:screenOrientation=”portrait” android:configChanges=”orientation|keyboardHidden”> </activity> This is applied in the manifest file AndroidManifest.xml.

tech