콘텐츠 스트레치 속성은 iOS 6.0에서 더 이상 사용되지 않으며, 올바르게 작동하는 대안을 찾을 수 없습니다. 여기 이미지보기 더 이상 사용되지 않는 방법
하지만 아이폰 OS 6.0에서 사용되지 않는 작품 코드입니다 :UIImageView *sectionsSeparator = [[UIImageView alloc] initWithFrame:CGRectMake(x, 0, separatorWidth, totalHeight)];
sectionsSeparator.image = [self imageForSectionsSeparator];
sectionsSeparator.contentStretch = CGRectMake(0, 0.25f, 1, 0.5f);
[self addSubview:sectionsSeparator];
나는 아래의 코드를했지만, 이미지가 올바르게 정렬되지 않습니다
UIImageView* sectionsSeparator = [[UIImageView alloc] initWithFrame:CGRectMake(x, 0, separatorWidth, totalHeight)];
[sectionsSeparator setImage:[[self imageForSectionsSeparator] resizableImageWithCapInsets:UIEdgeInsetsMake(0.0f, 0.25f, 1.0f, 0.5f)]];
[overlayView addSubview:sectionsSeparator];
을 어쩌면 내가 누락 뭔가, 어떤 제안?
사용하지 않는 방법이 무엇인지 알고 있습니다. 경고를 제거하려고했습니다. 이 방법을 시도했지만 이미지 크기가 올바르지 않습니다. – Vikings
아, 내 불량, 예 ur 코드가 작동하지 않습니다. 캡 인셋 대상이 콘텐츠 스트레치와 반대이므로 내 편집을 확인하십시오. – Pochi
감사합니다. – Vikings