fix: status header icon not align on iOS 15 issue
This commit is contained in:
parent
e5a3c4ae0d
commit
7e37d2c7c9
|
@ -639,7 +639,7 @@ extension StatusSection {
|
|||
) {
|
||||
if status.reblog != nil {
|
||||
cell.statusView.headerContainerView.isHidden = false
|
||||
cell.statusView.headerIconLabel.attributedText = StatusView.iconAttributedString(image: StatusView.reblogIconImage)
|
||||
cell.statusView.headerIconLabel.configure(attributedString: StatusView.iconAttributedString(image: StatusView.reblogIconImage))
|
||||
let headerText: String = {
|
||||
let author = status.author
|
||||
let name = author.displayName.isEmpty ? author.username : author.displayName
|
||||
|
@ -657,7 +657,7 @@ extension StatusSection {
|
|||
cell.statusView.headerInfoLabel.isAccessibilityElement = true
|
||||
} else if status.inReplyToID != nil {
|
||||
cell.statusView.headerContainerView.isHidden = false
|
||||
cell.statusView.headerIconLabel.attributedText = StatusView.iconAttributedString(image: StatusView.replyIconImage)
|
||||
cell.statusView.headerIconLabel.configure(attributedString: StatusView.iconAttributedString(image: StatusView.replyIconImage))
|
||||
let headerText: String = {
|
||||
guard let replyTo = status.replyTo else {
|
||||
return L10n.Common.Controls.Status.userRepliedTo("-")
|
||||
|
|
|
@ -111,6 +111,24 @@ extension MetaLabel {
|
|||
|
||||
}
|
||||
|
||||
extension MetaLabel {
|
||||
func configure(attributedString: NSAttributedString) {
|
||||
let attributedString = NSMutableAttributedString(attributedString: attributedString)
|
||||
|
||||
MetaText.setAttributes(
|
||||
for: attributedString,
|
||||
textAttributes: textAttributes,
|
||||
linkAttributes: linkAttributes,
|
||||
paragraphStyle: paragraphStyle,
|
||||
content: PlaintextMetaContent(string: "")
|
||||
)
|
||||
|
||||
textStorage.setAttributedString(attributedString)
|
||||
self.attributedText = attributedString
|
||||
setNeedsDisplay()
|
||||
}
|
||||
}
|
||||
|
||||
struct PlaintextMetaContent: MetaContent {
|
||||
let string: String
|
||||
let entities: [Meta.Entity] = []
|
||||
|
|
|
@ -237,7 +237,7 @@ extension ComposeViewModel: UITableViewDataSource {
|
|||
return
|
||||
}
|
||||
cell.statusView.headerContainerView.isHidden = false
|
||||
cell.statusView.headerIconLabel.attributedText = StatusView.iconAttributedString(image: StatusView.replyIconImage)
|
||||
cell.statusView.headerIconLabel.configure(attributedString: StatusView.iconAttributedString(image: StatusView.replyIconImage))
|
||||
let headerText: String = {
|
||||
let author = replyTo.author
|
||||
let name = author.displayName.isEmpty ? author.username : author.displayName
|
||||
|
|
|
@ -45,9 +45,10 @@ final class ReplicaStatusView: UIView {
|
|||
return attributedString
|
||||
}
|
||||
|
||||
let headerIconLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.attributedText = ReplicaStatusView.iconAttributedString(image: ReplicaStatusView.reblogIconImage)
|
||||
let headerIconLabel: MetaLabel = {
|
||||
let label = MetaLabel(style: .statusHeader)
|
||||
let attributedString = StatusView.iconAttributedString(image: StatusView.reblogIconImage)
|
||||
label.configure(attributedString: attributedString)
|
||||
return label
|
||||
}()
|
||||
|
||||
|
|
|
@ -73,9 +73,10 @@ final class StatusView: UIView {
|
|||
return attributedString
|
||||
}
|
||||
|
||||
let headerIconLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.attributedText = StatusView.iconAttributedString(image: StatusView.reblogIconImage)
|
||||
let headerIconLabel: MetaLabel = {
|
||||
let label = MetaLabel(style: .statusHeader)
|
||||
let attributedString = StatusView.iconAttributedString(image: StatusView.reblogIconImage)
|
||||
label.configure(attributedString: attributedString)
|
||||
return label
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in New Issue