【问题标题】:UIColor is there any one can tell me how i will codeUIColor 有没有人可以告诉我我将如何编码
【发布时间】:2025-12-31 22:35:01
【问题描述】:

用 uicolor 论证喜欢这张照片

【问题讨论】:

标签: swift methods arguments uicolor theos


【解决方案1】:

如您所见,目标类是:CNContactView 目标方法是:-(void) setBackgroundColor:(id)

你可以用你需要的任何值替换 (id) .. 在你的情况下 (UIColor *) 然后添加 "arg" 所以它会是 (UIColor *)arg

在你的 Tweak.x 中应该是这样的:

 %hook CNContactView
 -(void) setBackgroundColor:(UIColor *)arg {

       // You can use this one
          arg = [UIColor redColor];


      // Or this one
         arg = [UIColor colorWithRed:36.0f/255.0f green:52.0f/255.0f blue:71.0f/255.0f alpha:1.0];


       return %orig;

}

 %end 

【讨论】:

  • 虽然此代码可以解决问题,including an explanation 说明如何以及为什么解决问题将真正有助于提高您的帖子质量,并可能导致更多的赞成票。请记住,您正在为将来的读者回答问题,而不仅仅是现在提问的人。请编辑您的答案以添加解释并说明适用的限制和假设。
最近更新 更多