bluetooth99 2013-03-07 02:54 采纳率: 0%
浏览 17176
已采纳

给UIView添加虚线边框

怎么样给UIView添加一个虚线边框?

比如像这样:

CSDN移动问答

  • 写回答

2条回答 默认 最新

  • g989_1314125 2013-03-07 09:04
    关注

    简单:

    [yourView.layer setBorderWidth:5.0];
    [yourView.layer setBorderColor:[[UIColor colorWithPatternImage:[UIImage imageNamed:@"DotedImage.png"]] CGColor]];///just add image name and create image with dashed or doted drawing and add here
    

    这里只需要添加QuartzCore/QuartzCore.h框架,像下面一样导入.m文件:

    #import <QuartzCore/QuartzCore.h>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?