问题标签 [orientation]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
3495 浏览

iphone - iPad Orientation Paradigm

I'm not a super awesome designer so this new paradigm has me a little cranky. The iPad is not supposed to have a standard orientation, and should/shall display screen contents at whichever orientation the user decides. This has me sort of stumped. I can keep my UI designed the way I want it in landscape mode, but switching to portrait, I just can't determine the best way to present app content.

I know it's all speculation at this point, but what are the chances we can override the autoRotateToOrientation to only include the orientation of our choice? Apple ignored the HIG on a lot of issues for iPhone, including splash screens, saving state, etc.

I know we can't really argue with Apple, but doesn't it sound slightly ridiculous to reject an app because it won't rotate to portrait?

I've come a long way porting some code to iPad and it works great in landscape mode. I guess only time will tell. What do you all think?

0 投票
5 回答
12832 浏览

android - Android - 方向更改时强制重置区域设置

我尝试将我的应用程序中的语言环境强制为用户指定的语言环境。由于这可能用于演示,我想更改应用程序中的语言/区域设置,而不是随时更改整个设备。

我环顾四周并尝试使用我在这里找到的每一个提示。结果:我可以用新语言重新开始我的测试活动,但如果我改变方向,语言环境将始终重置为设备一。

上传了一个简约项目,以便您可以重现我的问题。请忽略 UI 的缩小,这并不重要 :)

0 投票
1 回答
1132 浏览

iphone - iPhone 阻止应用程序在视频停止时自动将方向更改为纵向

我的应用程序处于横向模式,我使用MPMoviePlayerController播放示例视频。它工作正常,但是当我用OK按钮停止视频时(或者如果我等到电影结束),方向会自动变为纵向。按下确定按钮时是否可以将应用程序保持在横向模式?

我在主视图控制器中使用以下代码强制横向模式:

0 投票
1 回答
1730 浏览

iphone - IPHONE: After Removing / Adding Subviews in the App Delegate, Orientation Changes Fail

I am using my application delegate to swap out views. First I remove the current view, then I add the new view, then I run a quartz animation.

No matter what view I load first, the orientation changes occur as expected. As soon as I start adding new views (removing the old) to the window in the application delegate, orientation changes no longer happen. Assume shouldAutorotateToInterfaceOrientation is present with YES in all my UIViewControllers.

I took out the quartz animation and here is where I am still stuck:

Switch views works fine. The first view always responds and switches orientation, then any changes I make to the window adding views (always removing the previous), diminishes the orientation changes.

If I load navVC right away it will rotate orientation, but when it's further down the line from a button event, I get the orientation problem I've described.

NSLog(@"subview count = %d", [[window subviews] count]); //always 1

I have tried using NSLog in didRotateFromInterfaceOrientation and this function obviously is only called when an orientation change occurs.

My app delegate window always only has one subview, so I'm lost!

0 投票
6 回答
15893 浏览

android - android:更改方向时如何保留我的arrayadapter/listview中的数据?

如上所述,它是自动完成的吗?一旦方向 chMYanges,我的列表是空的?不,我需要改变方向=)

我的适配器

我的 onCreate

多谢你们

0 投票
1 回答
1093 浏览

iphone - Orientation issues with Tab Bar Controller In WebView

I am new to iphone development. In my app, i am using number of viewControllers, web view, Tool bar, Tab Bar and so on. Here, i want to achieve orientation(portrait or landscape or vice versa) corresponding device view in all the web views. I could achieve orientation in all web views except those web views are coming under the tab bar controller web view(it may be an one of tab bar view controller or sub view of tab bar controller view).

Here i adding web view by using below code,

and using below methods for achieving orientation,

else {

}

please any one give soln!

0 投票
7 回答
75290 浏览

android - 如何在运行时锁定方向

有没有办法在运行时锁定方向?例如,如果用户当前处于横向状态,我想允许用户将屏幕锁定为横向并切换菜单选项。

0 投票
0 回答
650 浏览

android - 切换 Android SensorManager 速度。什么是好的做法?

我有兴趣随着时间的推移在不同的传感器方向速度之间切换以优化程序,即..电池寿命。该例程可能会被非常频繁地调用。我正在寻找正确的做法。

我应该注销侦听器,然后向 SensorManager.SENSOR_DELAY_NORMAL
注册
还是不应该费心注销侦听器?

谢谢。

0 投票
4 回答
1378 浏览

iphone - 如何检测 iPhone 面朝上放在桌子上时是否在旋转?

有没有办法检测趴在桌子上的 iPhone 是否正在旋转?我确实意识到加速度计没有报告这种运动,也没有报告给 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 方法。

有没有办法检测手机以这种方式旋转的角度变化?谢谢你。

0 投票
1 回答
1576 浏览

iphone - 方向更改时更改视图大小

我希望我的 UIView 子类能够在纵向安装时具有一定的大小,而在横向模式下安装时具有另一个大小。

当方向发生变化时,是否可以让视图向正在调整其大小的视图控制器指示它具有此“理想大小”?

澄清一下,我相信这不是自动调整蒙版可以做到的。我还认为 sizeThatFits: 将是我需要的,但是当方向改变时我没有看到它被调用。

我也知道我可以通过覆盖 superview 的 layoutSubviews 来完成此操作(或者可能是视图控制器的其他方法,但我希望将此行为嵌入到视图中以方便重用。