teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

4

ソースコードの変更

2020/02/09 14:33

投稿

Naoki_Pro
Naoki_Pro

スコア23

title CHANGED
File without changes
body CHANGED
@@ -89,7 +89,9 @@
89
89
 
90
90
  safaAreaHeight = screenHeight
91
91
  safeAreaWidth = screenWidth - leftPadding - rightPadding
92
+
92
93
          ↓このコメントアウトを外してもレイアウトがズレます。(上に寄る)
94
+
93
95
  // self.view.frame = CGRect(x: leftPadding, y: topPadding, width: safeAreaWidth, height: safaAreaHeight)
94
96
  mapView.frame = CGRect(x: leftPadding, y: topPadding, width: safeAreaWidth, height: safaAreaHeight)
95
97
 
@@ -104,7 +106,7 @@
104
106
 
105
107
  // self.view.frame = CGRect(x: leftPadding, y: topPadding, width: safeAreaWidth, height: safaAreaHeight)
106
108
  mapView.frame = CGRect(x: leftPadding, y: topPadding, width: safeAreaWidth, height: safaAreaHeight)
107
- print(mapView.frame)
109
+ print("mapView.frameだよ:(mapView.frame)")
108
110
 
109
111
  }
110
112
 

3

ソースコードの変更

2020/02/09 14:33

投稿

Naoki_Pro
Naoki_Pro

スコア23

title CHANGED
File without changes
body CHANGED
@@ -59,7 +59,7 @@
59
59
  view.backgroundColor = .clear
60
60
 
61
61
  settingLocationManeger()
62
- print(self.view.backgroundColor as Any)
62
+ print("背景色:(self.view.backgroundColor as Any)")
63
63
  }
64
64
 
65
65
  override func viewDidLoad() {
@@ -97,9 +97,11 @@
97
97
 
98
98
  safaAreaHeight = screenHeight - topPadding - buttomPadding
99
99
  safeAreaWidth = screenWidth - leftPadding - rightPadding
100
- print("こけこ(topPadding as Any)")
100
+ print("topPaddingだよ:(topPadding as Any)")
101
- print(self.view.frame)
101
+ print("view.frameだよ:(self.view.frame)")
102
+
102
103
  ↓このコメントアウトを外してもレイアウトがズレます。(上に寄る)
104
+
103
105
  // self.view.frame = CGRect(x: leftPadding, y: topPadding, width: safeAreaWidth, height: safaAreaHeight)
104
106
  mapView.frame = CGRect(x: leftPadding, y: topPadding, width: safeAreaWidth, height: safaAreaHeight)
105
107
  print(mapView.frame)

2

ソースコードの変更

2020/02/09 14:32

投稿

Naoki_Pro
Naoki_Pro

スコア23

title CHANGED
File without changes
body CHANGED
@@ -186,6 +186,7 @@
186
186
  }
187
187
 
188
188
  }
189
+ ```
189
190
 
190
191
  ### ログ画面
191
192
 

1

画像の追加

2020/02/09 14:28

投稿

Naoki_Pro
Naoki_Pro

スコア23

title CHANGED
File without changes
body CHANGED
@@ -18,6 +18,10 @@
18
18
  背景色がオレンジの時
19
19
  ![シュミレータ画面](dfce914907f44794f0c3a64e6ca034c7.png)
20
20
 
21
+ 下記のコードのコメントアウトを外した時(背景色オレンジ)
22
+ ![シュミレータ画面](2cbd56f9dc9acc13c22249eda9f81ee1.png)
23
+
24
+
21
25
  ### 該当のソースコード
22
26
 
23
27
  ViewController.swift
@@ -191,6 +195,9 @@
191
195
  背景色がオレンジの時
192
196
  ![ログ画面](208cf1006f41e0be274cca0754246557.png)
193
197
 
198
+ コメントアウトを外した時(なぜか2回実行されます)
199
+ ![ログ画面](770b251ae99677283e2801c2cbb49bf2.png)
200
+
194
201
  ### 仮説
195
202
 
196
203
  ログ画面を見る限り、背景色は透明の時もしっかり反映されているように見えます。