을 변경합니다 :서브 클래스 UIActivityIndicator이 내가 무슨 짓을 이미지
@implementation BGUIActivityIndicator
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
[self customInitialize];
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
[self customInitialize];
return self;
}
-(void)customInitialize
{
UIView * theImageView= [self findASubViewforClass:[UIImageView class]];//
UIImageView * theImageView1 = (UIImageView *) theImageView;
theImageView1.image = [UIImage imageNamed:@"spinner_blue"];
[theImageView1.image saveScreenshot];
while (false) ;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end
모든 것이 완벽한 것 같다. [theImageView1.image saveScreenshot]; 이전보기와 새보기 모두를 완벽하게 기록하십시오.
그러나 아무 것도 변경되지 않습니다. 왜?
UIActivityIndicator의 이미지를 변경하는 방법을 정확히 묻는 것은 아닙니다. 이미 그것의 톤이 있습니다. UIActivityIndicator를 서브 클래 싱하는 것이 가장 좋은 해결책이라고 생각하기 때문에 그것을 사용하고 싶습니다. 나는 그렇게 할 수 없다.
특히 검색 컨트롤러의 배경을 바꾸는 데 사용되는 방식이 왜 효과가 없는지 묻습니다.