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
b563bf56
Commit
b563bf56
authored
Jun 25, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 人脉
parent
b0d19ba9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
YHMyFriendsCell.swift
...axy/Classes/Modules/Community(社区)/V/YHMyFriendsCell.swift
+1
-0
YHNameCardInfoView.swift
.../Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
+30
-6
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHMyFriendsCell.swift
View file @
b563bf56
...
...
@@ -27,6 +27,7 @@ class YHMyFriendsCell: UITableViewCell {
lazy
var
headImgV
:
UIImageView
=
{
let
view
=
UIImageView
()
view
.
layer
.
cornerRadius
=
23.0
view
.
clipsToBounds
=
true
return
view
}()
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/V/YHNameCardInfoView.swift
View file @
b563bf56
...
...
@@ -47,7 +47,18 @@ class YHNameCardInfoView: DragCardView {
}
}
self
.
professionalLabel
.
text
=
result
self
.
detailLabel
.
text
=
self
.
userModel
.
signature
let
detail
=
self
.
userModel
.
signature
self
.
detailLabel
.
text
=
detail
self
.
grayContentView
.
isHidden
=
detail
.
isEmpty
var
detailHeight
=
self
.
getHeight
(
text
:
detail
,
font
:
self
.
detailLabel
.
font
!
,
width
:
Self
.
width
-
18.0
*
2
-
16.0
*
2
)
if
detailHeight
<
20.0
{
detailHeight
=
20.0
}
else
if
detailHeight
>
40.0
{
detailHeight
=
40.0
}
self
.
detailLabel
.
snp
.
updateConstraints
{
make
in
make
.
height
.
equalTo
(
detailHeight
)
}
self
.
signImgV
.
isHidden
=
(
self
.
userModel
.
isSign
!=
1
)
if
self
.
userModel
.
isSendRequest
{
...
...
@@ -59,6 +70,7 @@ class YHNameCardInfoView: DragCardView {
self
.
bottomBtn
.
backgroundColor
=
.
brandMainColor
self
.
bottomBtn
.
isUserInteractionEnabled
=
true
}
}
}
...
...
@@ -104,7 +116,7 @@ class YHNameCardInfoView: DragCardView {
label
.
textAlignment
=
.
center
label
.
textColor
=
UIColor
.
mainTextColor
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
14
)
label
.
numberOfLines
=
0
label
.
numberOfLines
=
2
return
label
}()
...
...
@@ -120,7 +132,7 @@ class YHNameCardInfoView: DragCardView {
label
.
textColor
=
UIColor
.
mainTextColor50
label
.
textAlignment
=
.
left
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
label
.
numberOfLines
=
0
label
.
numberOfLines
=
2
return
label
}()
...
...
@@ -218,19 +230,19 @@ class YHNameCardInfoView: DragCardView {
self
.
professionalLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
right
.
equalTo
(
-
18
)
make
.
height
.
equalTo
(
2
0
)
make
.
height
.
lessThanOrEqualTo
(
40.
0
)
make
.
top
.
equalTo
(
self
.
nameLabel
.
snp
.
bottom
)
.
offset
(
8
)
}
self
.
grayContentView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
right
.
equalTo
(
-
18
)
make
.
height
.
equalTo
(
72
)
make
.
top
.
equalTo
(
self
.
professionalLabel
.
snp
.
bottom
)
.
offset
(
10
)
}
self
.
detailLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
top
.
equalTo
(
16
)
make
.
height
.
equalTo
(
20.0
)
make
.
right
.
bottom
.
equalTo
(
-
16
)
}
...
...
@@ -238,8 +250,20 @@ class YHNameCardInfoView: DragCardView {
make
.
left
.
equalTo
(
18
)
make
.
right
.
equalTo
(
-
18
)
make
.
height
.
equalTo
(
46
)
make
.
top
.
equalTo
(
self
.
grayContentView
.
snp
.
bottom
)
.
offset
(
32
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
30
)
}
}
func
getHeight
(
text
:
String
,
font
:
UIFont
,
width
:
CGFloat
)
->
CGFloat
{
let
attributes
=
[
NSAttributedString
.
Key
.
font
:
font
]
as
[
NSAttributedString
.
Key
:
Any
]
let
boundingSize
=
(
text
as
NSString
)
.
boundingRect
(
with
:
CGSize
(
width
:
width
,
height
:
.
greatestFiniteMagnitude
),
options
:
.
usesLineFragmentOrigin
,
attributes
:
attributes
,
context
:
nil
)
.
size
let
textHeight
=
ceill
(
boundingSize
.
height
)
return
textHeight
}
}
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