Changes for alignment issue in iPhone 11 simulator and accessibility updates
This commit is contained in:
parent
42091d0873
commit
5502dd22f7
@ -21,8 +21,9 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
|
||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(percent: 10, horizontalAlignment: .fill)),
|
||||
(view: headlineBody, model: StackItemModel(percent: 90, horizontalAlignment: .fill))],
|
||||
|
||||
stack = Stack<StackModel>.createStack(with: [(view: leftLabel, model: StackItemModel(horizontalAlignment: .fill)),
|
||||
(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading))],
|
||||
axis: .horizontal)
|
||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
||||
}
|
||||
@ -36,10 +37,10 @@ import Foundation
|
||||
//--------------------------------------------------
|
||||
override open func setupView() {
|
||||
super.setupView()
|
||||
leftLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal)
|
||||
leftLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
|
||||
leftLabel.setContentHuggingPriority(.defaultHigh, for: .vertical)
|
||||
addMolecule(stack)
|
||||
stack.restack()
|
||||
updateAccessibilityLabel()
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
@ -70,6 +71,8 @@ import Foundation
|
||||
|
||||
func updateAccessibilityLabel() {
|
||||
|
||||
isAccessibilityElement = true
|
||||
|
||||
var message = ""
|
||||
|
||||
if let leftLabel = leftLabel.text {
|
||||
@ -85,6 +88,7 @@ import Foundation
|
||||
}
|
||||
|
||||
accessibilityLabel = message
|
||||
accessibilityTraits = (accessoryView != nil) ? .button : .none
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user