【问题标题】:Will Apple accept a custom UIAlert? [closed]Apple 会接受自定义 UIAlert 吗? [关闭]
【发布时间】:2011-07-05 14:40:37
【问题描述】:

我刚刚阅读了 iOS 人机界面指南。在关于警报、操作表和模式视图(参见here)的章节中,我发现了这一行:

警报的背景外观 是系统定义的,不能 改变了。

在我的应用程序中,我创建了自己的 UICustomAlert,继承自 UIAlertView 类,使用以下方法:

- (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];

它允许我显示具有透明背景的 UIAlert,并且只有一张图像(backgroundImage)。


但是知道iOS HIG写的是什么,你觉得苹果会拒绝这个应用吗?

谢谢。

【问题讨论】:

  • 我建议不要使用 UICustomAlert 的类名(如果那是真正的类名),因为 UI 前缀可能会在未来某个时候与 UIKit 中的类发生冲突!
  • 好的,谢谢您的提示。我会改的。
  • 您提交过应用吗?批准了吗?
  • 目前正在验证过程中。我让你知道。

标签: iphone objective-c appstore-approval


【解决方案1】:

我的直觉是你可能是安全的。没有什么能阻止你从头开始实施类似的东西。然而,我有一个应用程序因为不遵循 HIG 而被拒绝(他们不喜欢我措辞错误消息的方式),所以它们不仅仅是“指南”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-10
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 2021-12-16
    • 1970-01-01
    相关资源
    最近更新 更多