gpt4 book ai didi

ios - 我的 View 的渐变阴影?

转载 作者:行者123 更新时间:2023-11-29 11:12:58 25 4
gpt4 key购买 nike

我正在尝试为我的 View 背景设置色标,经过一些研究我发现了这个线程:Gradients on UIView and UILabels On iPhone

但是当我添加以下行时:

CAGradientLayer *gradient = [CAGradientLayer layer];

我明白了:

"_OBJC_CLASS_$_CAGradientLayer", referenced from: clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是什么错误?以及如何解决?

最佳答案

听起来您的项目没有添加 Quartzcore 框架。

添加框架(见图)

  1. 打开项目设置
  2. 选择构建阶段选项卡
  3. 点击 + 按钮,然后在出现的对话框中输入 quartz。

对话应该为您自动完成。

enter image description here

最后,一旦你完成了,你需要在任何你想使用它的地方导入框架头文件(或者在 project.pch 中 slam 它)

#import <QuartzCore/CoreAnimation.h>

关于ios - 我的 View 的渐变阴影?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10686285/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com