NSString representation of fractions using unicode

前端 未结 4 1685
傲寒
傲寒 2021-01-12 15:42

I am trying to \"nicely\" display fractions in my iPhone application. Previously I have been using a tedious switch statement leading to hardcoded unicode characters for the

4条回答
  •  感动是毒
    2021-01-12 16:03

    There are some included Unicode chars that do give actual fraction appearances, but they're limited to a 1/2, a 1/3 and a 1/4 I think.

    If you want this for arbitrary fractions, seems to me like you need a custom view that draws the appropriate look; either through using positioned subviews or drawRect:.

提交回复
热议问题