Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Worm Tab Title Size #13

Open
piyushkb opened this issue Jun 8, 2018 · 0 comments
Open

Worm Tab Title Size #13

piyushkb opened this issue Jun 8, 2018 · 0 comments

Comments

@piyushkb
Copy link

piyushkb commented Jun 8, 2018

Please initialize Fount in WormTabStripButton also , because if you don't initialize then font and size will not reflect first time
so i use -> self.font = AppTheme.TabStripFont()
class WormTabStripButton: UILabel{

var index:Int?
var paddingToEachSide:CGFloat = 10
var tabText:NSString?{
    didSet{
        let textSize:CGSize = tabText!.size(withAttributes: [NSAttributedStringKey.font: font])
        self.frame.size.width = textSize.width + paddingToEachSide + paddingToEachSide
        
        self.text = String(tabText!)
    }
}
//MARK: init
override init(frame: CGRect) {
    super.init(frame: frame)
    self.font = AppTheme.TabStripFont()
}
convenience required init(key:String) {
    self.init(frame:CGRect.zero)
    self.font = AppTheme.TabStripFont()
}



required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
    
}

}

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

No branches or pull requests

2 participants