iphone – 这个黑客会让苹果大发雷霆吗? (拒绝我的应用程序吗?
我从这里获取了这段代码
Changing the background color of a UIAlertView? UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@"Atention" message: @"YOUR MESSAGE HERE",nil) delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease]; [theAlert show]; UILabel *theTitle = [theAlert valueForKey:@"_titleLabel"]; [theTitle setTextColor:[UIColor redColor]]; UILabel *theBody = [theAlert valueForKey:@"_bodyTextLabel"]; [theBody setTextColor:[UIColor blueColor]]; UIImage *theImage = [UIImage imageNamed:@"Background.png"]; theImage = [theImage stretchableImageWithLeftCapWidth:16 topCapHeight:16]; CGSize theSize = [theAlert frame].size; UIGraphicsBeginImageContext(theSize); [theImage drawInRect:CGRectMake(0,theSize.width,theSize.height)]; theImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [[theAlert layer] setContents:[theImage CGImage]]; 由oxigen发布的. 我不太确定我应该在我的应用程序中使用此代码.苹果会不会有任何关于这个黑客的问题(他们会拒绝这个应用吗?) 解决方法
下划线作为您正在访问的属性的前缀(_titleLabel,_bodyTextLabel)清楚地表明这些是私有属性,不应该被修改. Apple最近开始扫描所有提交的二进制文件以访问私有方法和属性,这些值在您的应用程序中自行应该足以让您被拒绝.使用私有API,拒绝或拒绝是绝对不是一个好主意,因为它们通常是私有的,并且可能会因未来的操作系统更新而破坏您的应用程序.
此外,您通过更改警报颜色违反了iPhone Human Interface Guidelines:
再次,从iPhone Human Interface Guidelines:
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |