Text not vertically centered in UILabel

前端 未结 2 1660
無奈伤痛
無奈伤痛 2021-01-31 13:48

I\'ve created a Label with the following code :

func setupValueLabel() {
    valueLabel.numberOfLines = 1
    valueLabel.font = UIFont(name: \"Avenir-Black\", s         


        
2条回答
  •  遥遥无期
    2021-01-31 14:41

    Thanks to @rintaro, it works finally.

    One more thing for my case, it didn't work because I was setting ByWordWrapping. I had to set lineBreakMode as ByClipping.

提交回复
热议问题