방금 iOS 휴먼 인터페이스 가이드 라인을 읽었습니다.Apple은 사용자 지정 UIAlert를 허용합니까?
경고 의 배경 외관 시스템 정의하고 변경할 수 없습니다 : 장에 대한 경고, 액션 시트, 모달 뷰 (here 참조),이 선을 발견했다. 내 응용 프로그램에서
나는 다음과 같은 방법 아 파크의 UIAlertView 클래스에서 상속, 내 자신의 UICustomAlert을 만들어 :
내 UICustomAlert 이런 식으로 만들- (id)initWithImage:(UIImage *)image andButton:(UIButton *)button
{
if (self == [super init])
{
self.backgroundImage = image;
self.bigButton = button;
}
return self;
}
- (void)drawRect:(CGRect)rect
{
CGSize imageSize = self.backgroundImage.size;
[self.backgroundImage drawInRect:CGRectMake(0, 0, imageSize.width, imageSize.height)];
[self addSubview:bigButton];
}
- (void) show
{
[super show];
CGSize imageSize = self.backgroundImage.size;
self.bounds = CGRectMake(0, 0, imageSize.width, imageSize.height);
}
- (void)didAddSubview:(UIView *)subview
{
if ([subview isMemberOfClass:[UIImageView class]])
[subview removeFromSuperview];
}
:
UIAlertView *alert = [[UICustomAlert alloc] initWithImage:backgroundImage andButton:bigButton];
[alert show];
그것은 나를 허용을 투명한 배경과 하나의 이미지 (backgroundImage
) 만있는 UIAlert를 보여줍니다.
그러나 무엇이 iOS HIG으로 작성되었는지 알고 있으면 Apple이 앱을 거부한다고 생각합니까?
감사합니다.
UICustomAlert (실제 클래스 이름 인 경우)의 클래스 이름을 사용하지 않는 것이 좋습니다. UI 접두어가 향후 어느 시점에 UIKit의 클래스와 충돌 할 수 있습니다. – InsertWittyName
팁, 감사합니다. 나는 그것을 바꿀 것이다. –
앱을 제출 한 적이 있습니까? 승인 됐어? – ninjaneer