Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
59eabcca
Commit
59eabcca
authored
Mar 15, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pickerView 调整
parent
431078ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
48 deletions
+29
-48
YHOtherPickerView.swift
...(我的信息流程)/OtherInformation(其他信息)/V/YHOtherPickerView.swift
+29
-48
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(我的信息流程)/OtherInformation(其他信息)/V/YHOtherPickerView.swift
View file @
59eabcca
...
...
@@ -62,15 +62,33 @@ class YHOtherPickerView: UIView {
view
.
addSubview
(
cancelBtn
)
view
.
addSubview
(
confirmBtn
)
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
make
.
top
.
equalTo
(
kMargin
)
make
.
height
.
equalTo
(
24
)
make
.
centerX
.
equalToSuperview
()
}
cancelBtn
.
snp
.
makeConstraints
{
make
in
make
.
left
.
top
.
bottom
.
equalToSuperview
()
make
.
width
.
equalTo
(
60
)
make
.
left
.
equalTo
(
kMargin
)
make
.
width
.
height
.
equalTo
(
44
)
make
.
centerY
.
equalTo
(
titleLabel
.
snp
.
centerY
)
}
cancelBtn
.
titleLabel
?
.
textAlignment
=
.
left
confirmBtn
.
snp
.
makeConstraints
{
make
in
make
.
right
.
top
.
bottom
.
equalToSuperview
()
make
.
width
.
equalTo
(
60
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
kMargin
)
make
.
width
.
height
.
equalTo
(
44
)
make
.
centerY
.
equalTo
(
titleLabel
.
snp
.
centerY
)
}
confirmBtn
.
titleLabel
?
.
textAlignment
=
.
right
let
line
=
UIView
()
line
.
backgroundColor
=
.
separatorColor
view
.
addSubview
(
line
)
line
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
21
)
make
.
right
.
equalTo
(
-
21
)
make
.
height
.
equalTo
(
1
)
make
.
bottom
.
equalToSuperview
()
}
return
view
}()
...
...
@@ -79,7 +97,7 @@ class YHOtherPickerView: UIView {
let
label
=
UILabel
()
label
.
textColor
=
UIColor
.
mainTextColor
label
.
textAlignment
=
.
center
label
.
font
=
UIFont
.
PFSC_
R
(
ofSize
:
16
)
label
.
font
=
UIFont
.
PFSC_
M
(
ofSize
:
17
)
label
.
text
=
"请选择"
return
label
}()
...
...
@@ -87,7 +105,7 @@ class YHOtherPickerView: UIView {
lazy
var
cancelBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
"取消"
.
local
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_
R
(
ofSize
:
14
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_
M
(
ofSize
:
14
)
btn
.
setTitleColor
(
UIColor
.
mainTextColor
,
for
:
.
normal
)
btn
.
addTarget
(
self
,
action
:
#selector(
didClickCancelButton
)
,
for
:
.
touchUpInside
)
return
btn
...
...
@@ -96,8 +114,8 @@ class YHOtherPickerView: UIView {
lazy
var
confirmBtn
:
UIButton
=
{
let
btn
=
UIButton
()
btn
.
setTitle
(
"确定"
.
local
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_
R
(
ofSize
:
14
)
btn
.
setTitleColor
(
UIColor
(
hex
:
0x4487F9
)
,
for
:
.
normal
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_
M
(
ofSize
:
14
)
btn
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
normal
)
btn
.
addTarget
(
self
,
action
:
#selector(
didClickConfirmButton
)
,
for
:
.
touchUpInside
)
return
btn
}()
...
...
@@ -119,16 +137,12 @@ class YHOtherPickerView: UIView {
}
func
show
()
{
// showSelectType(&selectType)
UIApplication
.
shared
.
yhKeyWindow
()?
.
addSubview
(
self
)
}
static
func
show
(
type
:
YHOtherPickerViewType
,
selectType
:
YHFormPickerViewSubType
?
=
nil
,
callBack
:
@escaping
((
YHOtherPickerViewItemData
)
->
Void
))
{
let
picker
=
YHOtherPickerView
(
type
:
type
)
// picker.selectType = selectType
picker
.
selectBlock
=
callBack
picker
.
show
()
}
...
...
@@ -138,8 +152,8 @@ class YHOtherPickerView: UIView {
func
createUI
()
{
self
.
addSubview
(
blackMaskView
)
self
.
addSubview
(
whiteContentView
)
addSubview
(
blackMaskView
)
addSubview
(
whiteContentView
)
whiteContentView
.
addSubview
(
topView
)
whiteContentView
.
addSubview
(
pickerView
)
...
...
@@ -187,31 +201,6 @@ class YHOtherPickerView: UIView {
dismiss
()
}
func
showSelectType
(
_
selectType
:
inout
YHFormPickerViewSubType
?)
{
// 处理从外部传入的选中第几行的参数
// 是否找到选中行数据
// var selectIndex:Int = -1
// if let selectType = selectType, let arr = dataDict[type], !arr.isEmpty {
// for (index, item) in arr.enumerated() {
// if selectType.index == item.type.index {
// selectIndex = index
// break
// }
// }
// }
//
// if selectIndex != -1 { // 找到了选择行
// pickerView.selectRow(selectIndex, inComponent: 0, animated: true)
// } else { // 未找到选中行数据则滚动至第一行
// if dataDict[type]?.isEmpty == true { return }
// if let arr = dataDict[type], !arr.isEmpty {
// let item = arr[0]
// selectType = item.type
// pickerView.selectRow(0, inComponent: 0, animated: true)
// }
// }
}
func
getTitle
(
type
:
YHOtherPickerViewType
)
->
String
{
switch
type
{
case
.
language
:
...
...
@@ -249,14 +238,6 @@ extension YHOtherPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
return
arrData
.
count
}
// func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
// if 0 <= row && row < arrData.count {
// let item :YHOtherPickerViewItemData = arrData[row]
// return item.title
// }
// return ""
// }
func
pickerView
(
_
pickerView
:
UIPickerView
,
didSelectRow
row
:
Int
,
inComponent
component
:
Int
)
{
if
0
<=
row
&&
row
<
arrData
.
count
{
let
item
:
YHOtherPickerViewItemData
=
arrData
[
row
]
...
...
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