orientation

Android rotation prevents from .post() or UI thread running, related to network call

一笑奈何 提交于 2019-12-13 04:30:56
问题 In my application, I cannot edit any UI elements after a screen orientation is changed. Defined in FragmentActivity: static Handler uiHandler; Runned in Fragment in separate thread: uiHandler.post(new Runnable() { public void run() { chcemhovoritback.setBackgroundColor(Color.MAGENTA); } } I have runned one post() already in application and I if I run it before orientation changed, no problem. 回答1: When orientation changes, the activity is recreated. To prevent this from happening, add the

Android widget size issue on orientation change

牧云@^-^@ 提交于 2019-12-13 03:44:09
问题 Got some problems with my widget. When i put it on destop (eg 3x3 size) i can see following resize frame after long press on widget: Lets say, its ok. But when i change phone orientation to horizontal i got this: My widget get smaller and got wide resize frame As i measured, widget widgh is same as widget height previous orientation. Ok, so lets make resize frame little smaller to get some additional room on screen: Now change phone orientation again and: Widget size is crappy again. Whut i

Add different classes to VERTICAL or HORIZONTAL img

女生的网名这么多〃 提交于 2019-12-13 03:38:18
问题 I want to style differently the images if they are vertical or hotizontal. I'm playing around with this code but it's not working. Any ideas? JAVASCRIPT (function() { var orientation, img = new Image(); img.onload = function () { if (img.naturalWidth > img.naturalHeight) { $(img).addClass('landscape');} else (img.naturalWidth < img.naturalHeight) { $(img).addClass('portrait');} })(); CSS img {max-width:500px;} .landscape {max-width: 750px;} .portrait {max-width: 500px;} 回答1: I've just created

how to force orientation mode in a particular view

本秂侑毒 提交于 2019-12-13 03:05:08
问题 Doing an cordova app with angularjs as the frontend framework. I want a particular view in a phonegap/cordova app to appear in landscape mode. The various options I've explored so far are: Setting the config.xml. But you'd want this only if you intend the whole app to either be in portrait or landscape Adding manifest.json. (Also taking care that I do not have any orientation settings defined in my config.xml). My plan was to conditionally include the file when I want to set my orientation as

Fixed orientation for Iphone in universal app

非 Y 不嫁゛ 提交于 2019-12-13 01:45:06
问题 I have developed a universal app I want to support all orientation for IPAD but for Iphone I just want UIInterfaceOrientationPortrait and UIInterfaceOrientationPortraitUpsideDown only for this I have -(BOOL)shouldAutorotate { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){ return NO; }else{ return YES; } } - (NSUInteger)supportedInterfaceOrientations{ if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){ return

Fragment Orientation Change - Better Test than for Landscape

早过忘川 提交于 2019-12-13 01:15:28
问题 In 'Landscape' mode I have two FrameLayouts controlled by One Activity and utilizing two Fragments. In 'Portrait' mode I have one FrameLayout controlled by One Activity, on Selecting a Line I call another activity to display the detail using a detail fragment In the 'Portrait' detail activity I have the following check for orientation in the onCreate() method. if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { finish(); return; } The above works well

Iterating through : Reader.OnLoad

狂风中的少年 提交于 2019-12-13 00:20:55
问题 I think I'm quite close to resolving this for myself but I just can't get the last part working so was hoping for a little bit of help. I've spent the last couple of weeks trying to write this, using all sorts of resources from StackOverflow and although I've learned a fair bit in the process, I'm now at the stage of just wanting to get it working (frustrated!) When you run the script, it just gives a button which accepts multiple files to be selected. For each file selected, all I really

Detect orientation of an iPhone video from server

核能气质少年 提交于 2019-12-12 23:38:37
问题 I am attempting to detect the orientation of an iPhone video file (.mov) on upload through a PHP form so that I can use FFMPEG to correct it (a lot of the videos uploaded are shown on their side). I can not seem to find a way of accessing the orientation of the uploaded file on the server. Any ideas? 回答1: Using mediainfo $ mediainfo test.mp4 | grep Rotation Rotation : 90° You can use exec() to capture the output of this system call, and apply the orientation fix (90 degrees clockwise): $

Orientation handling in Interface Builder

筅森魡賤 提交于 2019-12-12 19:55:11
问题 I need to handle orientation (Portrait - Landscape) in my application. Basic layout of my screen is UIView -> UIImageView -> UITableView (Background = ClearColor) (in that z-order) so that it looks like the table has a background image. I need to do the following: Different images in UIImageView in both modes. Each cell in the table needs to have 3/4 images laid out side-by-side (3 in portrait and 4 in landscape). All of this needs to be done in the interface builder (to the maximum possible

iPhone UIImagePicker Camera in Landscape Orientation

笑着哭i 提交于 2019-12-12 18:18:03
问题 Is there any good way to set UIImagePicker to landscape orientation? I tried to call setStatusBarOrientation after presentModalViewController like following, [self presentModalViewController:picker animated:YES]; [[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO ]; However, the video duration view (00:00) on the right corner didn't rotate as orientation changed. 回答1: Unfortunately, according to the documentation, the image picker