問題タブ [uiscreen]

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 投票する
18 に答える
88279 参照

ios - [UIScreen mainScreen].bounds.size は iOS8 で向きに依存するようになっていますか?

iOS 7 と iOS 8 の両方で次のコードを実行しました。

以下は iOS 8 の結果です。

iOS 7 での結果との比較:

この変更を指定するドキュメントはありますか? それとも、iOS 8 API の一時的なバグですか?

0 投票する
2 に答える
20345 参照

ios - Swift を使用してメイン画面の明るさを調整する

Swift を使用してコードで iPhone のメイン画面の明るさを調整したいと思います。

私はObjective-Cでそれができることを知っています:

Swiftでこれを行うにはどうすればよいですか?

0 投票する
2 に答える
1645 参照

iphone - iOS 8 screen bounds different on device and simulator in landscape orientation

I have an app that runs in landscape orientation. I have used the code below to make it work on iOS 8. This code works perfectly on the simulator for ALL devices. However, when I run it on an iPhone 5 device the layout is wrong. Having read some other questions on here and other places I believed that the screen bounds had been swapped round on iOS 8 when running in landscape mode but it seems that this is not always the case.

Why is the simulator doing something completely different from the device? Does this only affect iPhone 5 or all iPhones/iPads? I don't have access to all devices running different iOS versions so was relying on the simulator to provide accurate results.

Is there a more reliable way of implementing this?

0 投票する
1 に答える
334 参照

device - UIScreen mainScreen の境界が iOS8 のシミュレーターと実際のデバイスで異なる

私が使用するiOS7アプリで:

次に、デバイスが iPhone 4 か iPhone 5 かに関する別のビューを読み込むために screenHeight を使用します。

主な問題は、iOS 8 のアプリをチェックしていたときに、シミュレーターが横向きで交換された値を返すため、screenHeight が実際には screenWidth になり、間違ったビューが読み込まれることです。解決しましたが、iOS 8 を搭載した実際のデバイスでアプリケーションが正常に動作しているため、App Store にはまだ更新を加えていません。適切なビューが読み込まれます。

ランドスケープ上の iOS8 を搭載した実際のデバイスは、以前の iOS7 と同様に値を返しますが、シミュレーター iOS 8 では、値は本来あるべきように交換されます。現在、アップデートを行うかどうかを判断するのは非常に困難です。

何が起こっているか知っている人はいますか?

ありがとう、マテジ

0 投票する
3 に答える
390 参照

ios - iOS8.0 (および 8.1) での 2 番目の UIScreen の自動回転の問題

私のアプリは 2 番目の画面 (外部モニター) を駆動しますが、回転に関して「奇妙な」ことがいくつか見られます (iOS7 では起こらないこと)

アプリを横向きで起動し (そして 2 番目の画面を接続)、ホーム ボタンを押してアプリをバックグラウンドにし、アプリを再度開くと、2 番目の画面 (モニターに接続されている) が 90 度回転し、画面半分。その後の回転量はこれを修正しません。

これはバグであると確信していますが、それ以外の場合は喜んでお知らせします。以下は、単純なシングル ビュー アプリケーションでそれを再現するためのコードです。

ありがとう