1
私はちょうどiOSヒューマンインターフェイスガイドラインを読んでいます。アップルはカスタムUIAlertを受け入れますか?
警告 の背景の外観は、システム定義であると を変更することはできません。章についてアラート、アクションシート、およびモーダルビュー(hereを参照)で、私はこの行を見つけました。次の方法whith
私はUIAlertViewクラスから継承し、私自身の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];
}
私はこのように私UICustomAlertを作成します。
UIAlertView *alert = [[UICustomAlert alloc] initWithImage:backgroundImage andButton:bigButton];
[alert show];
それは私を許可します透明な背景と1つの画像(backgroundImage
)を持つUIAlertを表示します。
しかし、iOS HIGで書かれていることを知っている、あなたはAppleがこのアプリケーションを拒否すると思いますか?
ありがとうございました。
UICustomAlertのクラス名(実際のクラス名であれば)から離れることをお勧めします。UIプレフィックスは将来のある時点でUIKitのクラスと衝突する可能性があります。 – InsertWittyName
よろしくお願いします。私はそれを変更します。 –
アプリを提出しましたか?承認されましたか? – ninjaneer