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
104bb280
Commit
104bb280
authored
Apr 18, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 消息
parent
0ceb7101
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
YHMessageSessionCell.swift
.../Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
+18
-16
No files found.
galaxy/galaxy/Classes/Modules/Message(消息)/V/YHMessageSessionCell.swift
View file @
104bb280
...
@@ -18,7 +18,7 @@ class YHMessageSessionCell: UITableViewCell {
...
@@ -18,7 +18,7 @@ class YHMessageSessionCell: UITableViewCell {
var
badgeLabel
:
UILabel
!
var
badgeLabel
:
UILabel
!
var
nameLabel
:
UILabel
!
var
nameLabel
:
UILabel
!
var
detailLabel
:
UILabel
!
var
detailLabel
:
UILabel
!
//
var timeLabel: UILabel!
var
timeLabel
:
UILabel
!
var
bottomLineView
:
UIView
!
var
bottomLineView
:
UIView
!
required
init
?(
coder
:
NSCoder
)
{
required
init
?(
coder
:
NSCoder
)
{
...
@@ -64,7 +64,8 @@ class YHMessageSessionCell: UITableViewCell {
...
@@ -64,7 +64,8 @@ class YHMessageSessionCell: UITableViewCell {
}
}
self
.
detailLabel
.
text
=
!
model
.
lastMessage
.
isEmpty
?
model
.
lastMessage
:
"暂无消息"
.
local
self
.
detailLabel
.
text
=
!
model
.
lastMessage
.
isEmpty
?
model
.
lastMessage
:
"暂无消息"
.
local
// self.timeLabel.text = formatTimestamp(Double(model.lastMessageTime))
self
.
timeLabel
.
text
=
formatTimestamp
(
Double
(
model
.
lastMessageTime
))
self
.
timeLabel
.
isHidden
=
model
.
lastMessage
.
isEmpty
}
}
func
formatTimestamp
(
_
timestamp
:
TimeInterval
)
->
String
{
func
formatTimestamp
(
_
timestamp
:
TimeInterval
)
->
String
{
...
@@ -126,13 +127,13 @@ class YHMessageSessionCell: UITableViewCell {
...
@@ -126,13 +127,13 @@ class YHMessageSessionCell: UITableViewCell {
detailLabel
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
detailLabel
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
12
)
contentView
.
addSubview
(
detailLabel
)
contentView
.
addSubview
(
detailLabel
)
//
timeLabel = UILabel()
timeLabel
=
UILabel
()
//
timeLabel.textColor = UIColor(hex:0x121A26, alpha: 0.3)
timeLabel
.
textColor
=
UIColor
(
hex
:
0x121A26
,
alpha
:
0.3
)
//
timeLabel.textAlignment = .right
timeLabel
.
textAlignment
=
.
right
//
timeLabel.font = UIFont.PFSC_R(ofSize:11)
timeLabel
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
11
)
//
timeLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
timeLabel
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
//
timeLabel.setContentHuggingPriority(.required, for: .horizontal)
timeLabel
.
setContentHuggingPriority
(
.
required
,
for
:
.
horizontal
)
//
contentView.addSubview(timeLabel)
contentView
.
addSubview
(
timeLabel
)
bottomLineView
=
UIView
()
bottomLineView
=
UIView
()
bottomLineView
.
backgroundColor
=
UIColor
(
hex
:
0xF0F3F7
)
bottomLineView
.
backgroundColor
=
UIColor
(
hex
:
0xF0F3F7
)
...
@@ -158,22 +159,23 @@ class YHMessageSessionCell: UITableViewCell {
...
@@ -158,22 +159,23 @@ class YHMessageSessionCell: UITableViewCell {
nameLabel
.
snp
.
makeConstraints
{
make
in
nameLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
iconContentView
.
snp
.
right
)
.
offset
(
16
)
make
.
left
.
equalTo
(
iconContentView
.
snp
.
right
)
.
offset
(
16
)
make
.
right
.
equalTo
Superview
(
)
.
offset
(
-
20
)
make
.
right
.
equalTo
(
timeLabel
.
snp
.
left
)
.
offset
(
-
20
)
make
.
top
.
equalTo
(
iconContentView
)
make
.
top
.
equalTo
(
iconContentView
)
make
.
height
.
equalTo
(
21
)
make
.
height
.
equalTo
(
21
)
}
}
detailLabel
.
snp
.
makeConstraints
{
make
in
detailLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalTo
(
nameLabel
)
make
.
left
.
equalTo
(
nameLabel
)
make
.
right
.
equalTo
(
timeLabel
)
make
.
top
.
equalTo
(
nameLabel
.
snp
.
bottom
)
.
offset
(
2
)
make
.
top
.
equalTo
(
nameLabel
.
snp
.
bottom
)
.
offset
(
2
)
make
.
height
.
equalTo
(
17
)
make
.
height
.
equalTo
(
17
)
}
}
//
timeLabel.snp.makeConstraints { make in
timeLabel
.
snp
.
makeConstraints
{
make
in
//
make.right.equalToSuperview().offset(-20)
make
.
right
.
equalToSuperview
()
.
offset
(
-
20
)
//
make.top.equalTo(nameLabel)
make
.
top
.
equalTo
(
nameLabel
)
//
make.height.equalTo(15)
make
.
height
.
equalTo
(
15
)
//
}
}
bottomLineView
.
snp
.
makeConstraints
{
make
in
bottomLineView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalTo
(
detailLabel
)
make
.
left
.
right
.
equalTo
(
detailLabel
)
...
...
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