SMIconLabel icon indicating copy to clipboard operation
SMIconLabel copied to clipboard

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

Open miraz029 opened this issue 8 years ago • 0 comments

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) }

miraz029 avatar Sep 07 '16 07:09 miraz029