Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
248d5f38
Commit
248d5f38
authored
Apr 07, 2021
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
阿斯顿发卡死;阿斯顿发了;撒点
parent
eaf854fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
8 deletions
+53
-8
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/ViewController/地图/SJMapViewController.swift
...inessPlatform/ViewController/地图/SJMapViewController.swift
+53
-8
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
248d5f38
No preview for this file type
GeliBusinessPlatform/ViewController/地图/SJMapViewController.swift
View file @
248d5f38
...
...
@@ -50,7 +50,7 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
initMapView
(
lat
:
coo
.
latitude
,
lng
:
coo
.
longitude
)
initSearch
()
// initUI()
// initUI()
}
func
backAction
()
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
...
...
@@ -88,8 +88,52 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
manger
.
startUpdatingLocation
()
manger
.
requestAlwaysAuthorization
()
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardShow(note:)
)
,
name
:
UIResponder
.
keyboardWillShowNotification
,
object
:
nil
)
// 监听键盘隐藏通知
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboardHidden(note:)
)
,
name
:
UIResponder
.
keyboardWillHideNotification
,
object
:
nil
)
}
//键盘弹出监听
@objc
func
keyboardShow
(
note
:
Notification
)
{
guard
let
userInfo
=
note
.
userInfo
else
{
return
}
guard
let
keyboardRect
=
userInfo
[
UIResponder
.
keyboardFrameEndUserInfoKey
]
as?
CGRect
else
{
return
}
//获取动画执行的时间
var
duration
=
userInfo
[
UIResponder
.
keyboardAnimationDurationUserInfoKey
]
as?
Double
if
duration
==
nil
{
duration
=
0.25
}
var
btmH
=
255
if
IS_IPHONE_X
{
btmH
=
289
}
//获取键盘弹起的高度
print
(
keyboardRect
.
height
)
btmView
.
snp
.
updateConstraints
{
(
make
)
in
make
.
bottom
.
equalTo
(
-
keyboardRect
.
height
)
make
.
left
.
right
.
equalTo
(
0
)
make
.
height
.
equalTo
(
btmH
)
}
}
@objc
func
keyboardHidden
(
note
:
Notification
){
var
btmH
=
255
if
IS_IPHONE_X
{
btmH
=
289
}
//获取键盘弹起的高度
btmView
.
snp
.
updateConstraints
{
(
make
)
in
make
.
bottom
.
equalTo
(
0
)
make
.
left
.
right
.
equalTo
(
0
)
make
.
height
.
equalTo
(
btmH
)
}
}
deinit
{
//记得要取消键盘通知的监听
NotificationCenter
.
default
.
removeObserver
(
self
)
}
//MARK: - 自定义delegate
func
clearSearchAction
()
{
print
(
"清楚搜索文字"
)
...
...
@@ -110,9 +154,9 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
@objc
func
backToCenter
(){
mapView
.
setCenter
(
CLLocationCoordinate2DMake
(
lat
,
lng
),
animated
:
false
)
}
// @objc func backAction(){
// self.navigationController?.popViewController(animated: true)
// }
// @objc func backAction(){
// self.navigationController?.popViewController(animated: true)
// }
@objc
func
submitAction
(){
if
adrStr
!=
nil
{
...
...
@@ -240,7 +284,7 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
listView
=
tbv
var
btnH
=
49
if
IS_IPHONE_X
{
btnH
=
83
btnH
=
83
}
tbv
.
snp
.
makeConstraints
{
(
make
)
in
make
.
top
.
left
.
right
.
equalTo
(
0
)
...
...
@@ -276,8 +320,9 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
}
}
let
locationM
=
AMapLocationManager
()
var
btmView
=
UIView
()
func
initMapView
(
lat
:
CLLocationDegrees
,
lng
:
CLLocationDegrees
)
{
let
btmView
=
UIView
()
self
.
view
.
addSubview
(
btmView
)
var
btmH
=
255
if
IS_IPHONE_X
{
...
...
@@ -307,7 +352,7 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
img
.
image
=
UIImage
()
}
}
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
cancelKeyboard
)
)
mapView
.
addGestureRecognizer
(
tap
)
...
...
@@ -321,7 +366,7 @@ class SJMapViewController: UIViewController,NavBarViewDelegate,AMapLocationManag
make
.
bottom
.
equalTo
(
btmView
.
snp_top
)
.
offset
(
-
13.5
)
}
}
func
initSearch
()
{
search
=
AMapSearchAPI
()
search
.
delegate
=
self
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment