怎麼樣給UIView添加一個虛線邊框?
比如像這樣:
簡單:
[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>