答案 0 :(得分:1)
您可以创建UIView的子类并覆盖drawRect。
例如,我创建了一个名为CrinkedView的子类。 .h看起来像这样:
#import "CrinkedView.h"
@implementation CrinkedView
-(void)setCrinkedImage:(UIImage *)crinkedImage
{
_crinkedImage = crinkedImage;
[self setNeedsDisplay];
}
- (void)drawRect:(CGRect)rect {
[[UIImage imageNamed:@"vI745.jpg"] drawInRect:self.bounds];
if (self.crinkedImage) {
[self.crinkedImage drawInRect:self.bounds blendMode:kCGBlendModeMultiply alpha:1.0];
}
}
@end
.m就像这样:
204: has no json response, but need to treat as success
406: should redirect to sign in
422: has json for error message
< 400 (but not 204): success, will have json
>= 400 (but not 422): error, will not have json