Draw line in UIView

后端 未结 8 839
粉色の甜心
粉色の甜心 2020-12-02 05:52

I need to draw a horizontal line in a UIView. What is the easiest way to do it. For example, I want to draw a black horizontal line at y-coord=200.

I am NOT using In

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 06:26

    One other (and an even shorter) possibility. If you're inside drawRect, something like the following:

    [[UIColor blackColor] setFill];
    UIRectFill((CGRect){0,200,rect.size.width,1});
    

提交回复
热议问题