forked from organicmaps/organicmaps
[ios] fix: Text trimming on the Menu screen on small screen #7605
Signed-off-by: Valery Lozko <valerylozko@gmail.com>
This commit is contained in:
parent
9c7fc19a4a
commit
514423a829
2 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,8 @@ class BottomMenuItemCell: UITableViewCell {
|
|||
@IBOutlet private var badgeCountLabel: UILabel!
|
||||
@IBOutlet private var separator: UIView!
|
||||
@IBOutlet private var icon: UIImageView!
|
||||
@IBOutlet private var badgeSpacingConstraint: NSLayoutConstraint!
|
||||
@IBOutlet private var badgeBackgroundWidthConstraint: NSLayoutConstraint!
|
||||
var anchorView: UIView {
|
||||
get {
|
||||
return icon
|
||||
|
@ -20,6 +22,13 @@ class BottomMenuItemCell: UITableViewCell {
|
|||
label.text = title
|
||||
badgeBackground.isHidden = badgeCount == 0
|
||||
badgeCountLabel.text = "\(badgeCount)"
|
||||
if badgeCount == 0 {
|
||||
badgeSpacingConstraint.constant = 0
|
||||
badgeBackgroundWidthConstraint.constant = 0
|
||||
} else {
|
||||
badgeSpacingConstraint.constant = 8
|
||||
badgeBackgroundWidthConstraint.constant = 32
|
||||
}
|
||||
isEnabled = enabled
|
||||
icon.setStyleAndApply(isEnabled ? "MWMBlack" : "MWMGray")
|
||||
label.setStyleAndApply(isEnabled ? "blackPrimaryText" : "blackHintText")
|
||||
|
@ -31,6 +40,8 @@ class BottomMenuItemCell: UITableViewCell {
|
|||
icon.setStyleAndApply("MWMBlue")
|
||||
label.setStyleAndApply("linkBlueText")
|
||||
badgeBackground.isHidden = true
|
||||
badgeSpacingConstraint.constant = 0
|
||||
badgeBackgroundWidthConstraint.constant = 0
|
||||
isEnabled = true
|
||||
isPromo = true
|
||||
}
|
||||
|
|
|
@ -91,7 +91,9 @@
|
|||
</constraints>
|
||||
<connections>
|
||||
<outlet property="badgeBackground" destination="con-tP-3dJ" id="vH5-Rd-uqS"/>
|
||||
<outlet property="badgeBackgroundWidthConstraint" destination="ubK-0L-pDn" id="D3B-sV-eGO"/>
|
||||
<outlet property="badgeCountLabel" destination="FT9-8n-RZm" id="HLY-2S-do9"/>
|
||||
<outlet property="badgeSpacingConstraint" destination="RJA-NS-MXP" id="Hpf-eq-1C1"/>
|
||||
<outlet property="icon" destination="8oJ-8z-qRL" id="qcD-Kv-c5l"/>
|
||||
<outlet property="label" destination="5Uc-o1-PsF" id="y4l-b6-MCt"/>
|
||||
<outlet property="separator" destination="4OJ-wN-dY4" id="Kkv-HO-0eK"/>
|
||||
|
|
Loading…
Add table
Reference in a new issue