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
b3785e7f
Commit
b3785e7f
authored
Jul 02, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行 间距
parent
1ce34384
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
YHActivityDetailCell1.swift
.../Community(社区)/Activity(活动)/V/YHActivityDetailCell1.swift
+15
-0
YHActivityTipsItemView.swift
...Community(社区)/Activity(活动)/V/YHActivityTipsItemView.swift
+29
-0
YHActivityTitleItemView.swift
...ommunity(社区)/Activity(活动)/V/YHActivityTitleItemView.swift
+6
-2
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/V/YHActivityDetailCell1.swift
View file @
b3785e7f
...
...
@@ -80,6 +80,21 @@ extension YHActivityDetailCell1 {
func
updateUI
()
{
describeLable
.
text
=
dataModel
.
introduce
// 创建NSMutableAttributedString实例
let
attributedText
=
NSMutableAttributedString
(
string
:
dataModel
.
introduce
)
// 设置行距,这里设置为10.0
let
paragraphStyle
=
NSMutableParagraphStyle
()
paragraphStyle
.
lineSpacing
=
6.0
// 设置行距
// 将段落样式添加到NSMutableAttributedString
attributedText
.
addAttribute
(
.
paragraphStyle
,
value
:
paragraphStyle
,
range
:
NSRange
(
location
:
0
,
length
:
attributedText
.
length
))
// 设置UILabel的attributedText属性
describeLable
.
attributedText
=
attributedText
describeLable
.
snp
.
updateConstraints
{
make
in
let
topMargin
=
dataModel
.
introduce
.
isEmpty
?
0.0
:
24.0
make
.
top
.
equalTo
(
nameLabel
.
snp
.
bottom
)
.
offset
(
topMargin
)
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/V/YHActivityTipsItemView.swift
View file @
b3785e7f
...
...
@@ -98,6 +98,19 @@ extension YHActivityTipsItemView {
return
}
describeLable
.
text
=
txt
// 创建NSMutableAttributedString实例
let
attributedText
=
NSMutableAttributedString
(
string
:
txt
)
// 设置行距,这里设置为10.0
let
paragraphStyle
=
NSMutableParagraphStyle
()
paragraphStyle
.
lineSpacing
=
6.0
// 设置行距
// 将段落样式添加到NSMutableAttributedString
attributedText
.
addAttribute
(
.
paragraphStyle
,
value
:
paragraphStyle
,
range
:
NSRange
(
location
:
0
,
length
:
attributedText
.
length
))
// 设置UILabel的attributedText属性
describeLable
.
attributedText
=
attributedText
layoutIfNeeded
()
}
...
...
@@ -105,7 +118,23 @@ extension YHActivityTipsItemView {
guard
let
model
=
dataModel
else
{
return
}
describeLable
.
text
=
model
.
tips
// 创建NSMutableAttributedString实例
let
attributedText
=
NSMutableAttributedString
(
string
:
model
.
tips
)
// 设置行距,这里设置为10.0
let
paragraphStyle
=
NSMutableParagraphStyle
()
paragraphStyle
.
lineSpacing
=
6.0
// 设置行距
// 将段落样式添加到NSMutableAttributedString
attributedText
.
addAttribute
(
.
paragraphStyle
,
value
:
paragraphStyle
,
range
:
NSRange
(
location
:
0
,
length
:
attributedText
.
length
))
// 设置UILabel的attributedText属性
describeLable
.
attributedText
=
attributedText
layoutIfNeeded
()
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/Activity(活动)/V/YHActivityTitleItemView.swift
View file @
b3785e7f
...
...
@@ -34,6 +34,10 @@ class YHActivityTitleItemView: UIView {
lable0
.
isEditable
=
false
lable0
.
isSelectable
=
false
lable0
.
backgroundColor
=
.
clear
lable0
.
textContainerInset
=
UIEdgeInsets
.
zero
// 消除文本容器的内边距
lable0
.
textContainer
.
lineFragmentPadding
=
0
return
lable0
}()
...
...
@@ -99,11 +103,11 @@ extension YHActivityTitleItemView {
nameTextView
.
text
=
model
.
name
if
model
.
tag
==
1
{
nameTextView
.
attributed
.
text
=
"""
\(
model
.
name
+
" "
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
2
4
))
)\(
.
image
(
UIImage
(
named
:
"activity_vip_icon2"
)
!
,
.
custom
(
.
offset
(
CGPoint
(
x
:
0
,
y
:
-
7
)),
size
:
.
init
(
width
:
44
,
height
:
34
)))
)
\(
model
.
name
+
" "
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
2
2
))
)\(
.
image
(
UIImage
(
named
:
"activity_vip_icon2"
)
!
,
.
custom
(
.
offset
(
CGPoint
(
x
:
0
,
y
:
-
9.0
)),
size
:
.
init
(
width
:
44
,
height
:
34
)))
)
"""
}
else
{
nameTextView
.
attributed
.
text
=
"""
\(
model
.
name
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
2
4
))
)
\(
model
.
name
,
.
foreground
(
UIColor
.
mainTextColor
),
.
font
(
UIFont
.
PFSC_B
(
ofSize
:
2
2
))
)
"""
}
...
...
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