Display fraction number in UILabel

前端 未结 5 584
情歌与酒
情歌与酒 2020-12-17 08:20

I am working on the app in which I have to show fraction number on label.

NSMutableAttributedString   * hogan = [[NSMutableAttributedString alloc] initWithSt         


        
5条回答
  •  甜味超标
    2020-12-17 08:44

    You can achieve it by setting the UILabel's text property to the Unicode of 1/2:

    myLblName.text = [NSString stringWithFormat:@"%C",0x00bd];
    

    And also see below link
    NSString: Looking for Unicode for superscript: 1, 2, 3
    Might be helpful for you. Enjoy ;)

提交回复
热议问题