orientation

after launch in landscape cannot force view to start in portrait

a 夏天 提交于 2019-12-11 12:04:41
问题 Hy, I know that this subject has been asked before, but I went over all solutions and none solved the case I'm having. My app is all in portrait format, only one view controller in landscape format. I added to all view controllers the following code to force Portrait Orientation regardless the device orientation: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationMaskPortrait; } -(BOOL)shouldAutorotate{ return NO; } -

Handling a Runnable thread during configuration changes

依然范特西╮ 提交于 2019-12-11 11:45:12
问题 With the following codes, I was wondering how to handle a Runnable object (for a timer) and a ViewTreeObserver (for handling configuration changes between portrait and landscape) together in one activity, because my View (linearLayout) doesn't get recognized until later: MainActivity: public class MainActivity extends AppCompatActivity { private int displayWidth, displayHeight; private LinearLayout linearLayout; // Initializes fields for the timer. private TextView timer; private long

layout-land is not working?

若如初见. 提交于 2019-12-11 10:58:58
问题 I did some researches about this question but I couldn't find my answer. So, yes I did create a folder under res called "layout-land" and I put a separate main.xml in it. I intentionally deleted some images in the main.xml in the layout-land and I noticed that these images were still there when I rotated the android phone to horizontal. Many questions similar to mine are caused by adding onConfigurationChanged to manifest. But I did NOT add anything to manifest as explained by this link

Fix iPad status bar orientation as portrait

耗尽温柔 提交于 2019-12-11 10:12:52
问题 I have an iPad application with a simple tab bar. I need to fix the orientation as portrait. I do that by setting "Portrait (bottom home button)" in the "Supported interface orientation" field in the plist file. The problem is that the status bar still move when rotating the iPad... how can I fix it ?? Thanks for reading. 回答1: Remove the default implementation of shouldAutorotateToInterfaceOrientation: from all your view controllers. 来源: https://stackoverflow.com/questions/5140600/fix-ipad

MediaStore.ACTION_VIDEO_CAPTURE crashes camera app if device is portrait

岁酱吖の 提交于 2019-12-11 10:07:10
问题 I'm using a standard MediaStore.ACTION_VIDEO_CAPTURE Intent call (e.g. the one on the Developer site or lots of StackOverflow threads) to record some video. I'm testing it on a (real) Nexus 7 (API 21) and it works fine... so long as the device's display is in a landscape orientation when the ( native ) Android camera app starts up . If it is portrait, reverse-portrait or reverse-landscape, the camera app stops part way through its initialization ("Unfortunately, Camera has stopped") and

Intent for screen orientation change

倾然丶 夕夏残阳落幕 提交于 2019-12-11 10:04:51
问题 I'm wondering whether android broadcasts a intent when the screen orientation changes. I am programming a live wallpaper and want to deal with it when the screen orientation changes. I can handle the same with regular apps. 回答1: Android system doesn't broadcast an Intent, but restarts the activity by default. If you want to override this you should override onConfigurationChanged(Configuration) method of your activity. To get this method called you should also specify the changing in android

Force Interface orientation Landscape on a viewController when the rest of the application is in portrait mode

吃可爱长大的小学妹 提交于 2019-12-11 09:00:41
问题 Good evening all! I am developing an application in Portait orientation and i was wander if there is a way for me to change the orientation of only one view to landspace left without messing with the rest of the app. I tried returning - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft); //return UIInterfaceOrientationIsLandscape(interfaceOrientation); } but with no luck... In IB the

SensorManager.getRotationMatrix strange behavior

北慕城南 提交于 2019-12-11 08:16:41
问题 I am implementing a compass, getting readings from SensorManager.getRotationMatrix (see code below). I have an imageView that rotates using RotateAnimation . The compass and animation works fine except for one issue: Through the SensorManager.getOrientation I get an array of three values - Azimuth, Pitch and Roll. I only use the array[0] which holds the Azimuth Value If I hold the phone flat and turn it around on the Z axis (azimuth) - it works perfectly. But, the minute I tilt the phone on

Is it possible to just rotate some views in screen when rotate my android phone?

妖精的绣舞 提交于 2019-12-11 07:41:17
问题 When screenOrientation="portrait" , it looks like: When screenOrientation="landscape" , it looks like: You can see only the center view has been rotated, others are not changed. Is it possible in android, and how to implement it if yes? 回答1: See: http://developer.android.com/guide/practices/screens_support.html The part about orientation for example: res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation res/layout-xlarge-port/my_layout.xml // layout for extra

Text in cell truncates on rotate! (edit: also cells screw up on scroll)

元气小坏坏 提交于 2019-12-11 07:19:02
问题 The problem: I have a UITableViewCell which word wraps the text when it first appears, but if you rotate to landscape and back to portrait again, the text has been truncated! Why is this or how can I fix it? Extra Detail: My cell is of style UITableViewCellStyleSubtitle. In order to wordwrap the text (the textLabel of UITableViewCellStyleSubtitle, not the detailTextLabel), I calculate how many lines high the text is, and set this via cell.textLabel.numberOfLines I cant simply set