orientation

Lock device orientation - React Native (Android)

主宰稳场 提交于 2019-12-10 12:33:08
问题 I'm using React Native 0.29 and developing for Android. I'm trying to lock the device orientation. What I need is to lock the screen in portrait mode. I tried with this repository https://github.com/yamill/react-native-orientation but it is not supporting RN 0.29 yet. Is there any way I can lock the device orientation? Maybe any native Android hack with android studio? 回答1: Just add android:screenOrientation="portrait" to the activity in the AndroidManifest.xml. 回答2: There is a pull request

iOs set Storyboard orientation to landscape

我的梦境 提交于 2019-12-10 12:31:19
问题 I wish to set View Controller's orientation as landscape in Storyboard. I referred the below links but couldn't find the "orientation" option anywhere (screenshot attached) Links referred: Designing in landscape with Storyboards iOS 7 XCode 5 Storyboard set orientation to Landscape 回答1: In xcode 8 the option to change the orientation is not from Inspector, you will be able to change the orientation from bottom bar, please check the screenshot 回答2: Xcode 8 provides the option for landscape

AsyncTaskLoader doesn't call onLoadFinished

本秂侑毒 提交于 2019-12-10 12:26:01
问题 I have a problem with AsyncTaskLoader . When app is starting, it works fine. Then I call onRefreshStarted , and again all is good. But if change orientation, AsyncTaskLoader start processing loadInBackground , but onLoadFinished is never called. What is wrong? Here's simplified SherlockFragment: public class MyFragment extends SherlockFragment implements LoaderCallbacks<Object> { PullToRefreshLayout Rl; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

Avoid restarting threads on orientation change

风流意气都作罢 提交于 2019-12-10 12:17:52
问题 There are some threads in my activity's oncreate() method. When the orientation changes the threads are restarting again (new instance of threads gets created on every orientation change). I don't want to use android:configChanges or android:screenOrientation . Because the Activity is orientation dependent. 回答1: Use android:configChanges , but in overrided onConfigurationChanged() method only call super.onConfigurationCanged() method (or don't override it, generally). In time of rotation

How I can have previewing permanently when capture video for android?

泪湿孤枕 提交于 2019-12-10 11:56:51
问题 I am writing a video capture app for android. I have preview first time I want to capture. But after I press stop, I no longer get preview when I start recording again. How can I have preview option permanently? protected void startRecording() throws IOException { String state = android.os.Environment.getExternalStorageState(); if (!state.equals(android.os.Environment.MEDIA_MOUNTED)) { throw new IOException("SD Card is not mounted. It is " + state + "."); } // make sure the directory we plan

iphone always returns UIInterfaceOrientationPortrait

倾然丶 夕夏残阳落幕 提交于 2019-12-10 11:29:50
问题 I need to make sure that when my UIViewController loads, it rotates as needed. I have implemented the shouldAutorotateToInterfaceOrientation methods and its all working fine, except when the app first loads (when the iphone is in landscape mode) or when going from a UIViewController which was is portrait mode the interfaceOrientation and the [[UIDevice currentDevice] orientation] always returns portrait mode! I have been reading blogs and even some SO questions, but none of them seem to

Handling multiple tabs during landscape and portrait in android

徘徊边缘 提交于 2019-12-10 09:47:07
问题 I have specified different layouts for landscape and portrait using layout and layout-land, my application have multiple tabs. Each time when changing from portrait to landscape or landscape to portrait screen changes to 1st tab even selected tab is different one. How can we solve this problem. 回答1: You can use onRetainNonConfigurationInstance() to solve this issue. public void onCreate(Bundle savedInstanceState) { .... lastTab = (Integer) getLastNonConfigurationInstance(); ..... if(lastTab !

Irrelevant change of button size in Right to Left orientation

回眸只為那壹抹淺笑 提交于 2019-12-10 08:23:25
问题 I have 9 jbuttons added to jpanel and the panel added to jscrollpane and it added to jframe. http://www.pic1.iran-forum.ir/images/up9/95426323683658592564.jpg when i change frame orientation by: applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); the panel move to right and size of buttons got fixed and wouldn`t fill the panel but you see in the image below that scrolbar is fill all width of panel http://www.pic1.iran-forum.ir/images/up9/60975202722295688553.jpg (i used

how can i set landscape orientation when playing a video from webview

主宰稳场 提交于 2019-12-09 19:08:10
问题 i have a webview with a video link, the app is only portrait orientation but i need to change orientation when the video is in fullscreen and use all screen. Thanks for your help. 回答1: Put this in your AppDelegate : - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { id presentedViewController = [window.rootViewController presentedViewController]; NSString *className = presentedViewController ? NSStringFromClass(

Testing/mocking an orientation change in Chrome?

不问归期 提交于 2019-12-09 18:03:23
问题 We're writing a mobile app using jQuery mobile and do most of the javascript debugging in Chrome. One thing I can't test however is an orientation change, from portrait to landscape and vice versa. I have to use a phone to fire that event, and am unable to debug the javascript window.orientationchange event without Chrome. Or so it would seem. Is there a way to mock this event in Chrome somehow? 回答1: Since a desktop device doesn't have any real orientation changes, like mobile devices does