Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

Text not showing properly for icon position ( .Right, .Center ) #2

Open
miraz029 opened this issue Sep 7, 2016 · 0 comments
Open

Comments

@miraz029
Copy link

miraz029 commented Sep 7, 2016

labelLeft.icon = UIImage(named: "Bell") // Set icon image
labelLeft.iconPadding = 5 // Set padding between icon and label
labelLeft.numberOfLines = 1 // Required
labelLeft.iconPosition =( .Right, .Center ) // Icon position

In this case text is not shown properly. Fixed it by updating SMIconLabel as
if iconPosition.horizontal == .Right {
if textAlignment == .Right {
iconView.frame = CGRectOffset(iconView.frame, frame.width - iconView.frame.width, iconYPosition)
// newRect = CGRectMake(frame.width - size.width - iconView.frame.width - iconPadding, 0, size.width, height)
newRect = CGRectMake(0, 0, frame.width - (iconView.frame.width + iconPadding), height)
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant