小编sur*_*pen的帖子

Swift - UI 按钮阴影渐变

我正在尝试在 Swift 中重新创建一个这样的按钮: 发光按钮效果

我已经能够使用这里的帮助从 Sketch 准确地创建按钮内部的渐变: 回答的问题

现在我正在尝试重新创建按钮后面的发光效果。我正在考虑在它后面创建一个子视图并使用高斯模糊过滤器来绘制它。现在我被困在如何实现这一点上,还没有找到一个好的解决方案。正常的 CALayer 阴影不适用于渐变,我迷路了。任何帮助表示赞赏

gradient calayer swift swift3

6
推荐指数
1
解决办法
5052
查看次数

setObjectForKey:异常:对象不能为零

我正在使用 Parse 和 Xcode 构建一个应用程序。使用 ParsePFTableView时出现错误:

由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“*** setObjectForKey:对象不能为零(键:类名)”

我知道我没有在代码中的某处设置密钥,但我不知道在哪里以及如何修复它。

#import "TableViewController.h"
#import <Parse/Parse.h>

@interface TableViewController ()

@end

@implementation TableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // This table displays items in the Todo class
        self.parseClassName = @"Todo";
        self.pullToRefreshEnabled = YES;
        self.paginationEnabled = YES;
        self.objectsPerPage = 25;
    }
    return self;
}


- (void)viewDidLoad
{
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line …
Run Code Online (Sandbox Code Playgroud)

cells uitableview ios parse-platform

5
推荐指数
1
解决办法
5582
查看次数

为什么我收到Apple Mach-O Linker错误?

我正在努力让一个项目与Parse和Facebook合作.运行此项目时,构建失败,我得到一个Mach-O Linker Error:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_SLComposeViewController", referenced from:
  objc-class-ref in Parse(PF_Twitter.o)
  "_OBJC_CLASS_$_SLRequest", referenced from:
  objc-class-ref in Parse(PF_Twitter.o)
  "_SLServiceTypeTwitter", referenced from:
       -[PF_Twitter getAccessTokenForReverseAuthAsync:localTwitterAccount:] in  Parse(PF_Twitter.o)
      -[PF_Twitter getLocalTwitterAccountAsync] in Parse(PF_Twitter.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

ViewController.h:

#import <UIKit/UIKit.h>
#import <Parse/Parse.h>

@interface ViewController : UIViewController

@end

// Implement both delegates
@interface DefaultSettingsViewController :
UIViewController <PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate>

@end
Run Code Online (Sandbox Code Playgroud)

而ViewController.m:

#import "ViewController.h"


@interface ViewController …
Run Code Online (Sandbox Code Playgroud)

mach-o objective-c ios parse-platform

4
推荐指数
1
解决办法
5762
查看次数

移动平均线的D3.js"错误:<path>属性的值无效"

我试图在图表的其余部分创建移动平均线.我试图做类似的东西这个.
但是,对于我的数据点,我不断得到错误:

"错误:属性d的值无效="M1.2121212121212122,NaNL1.4141414141414141,NaNC1.6161616161616161,NaN,2.0202020202020203,NaN,2.4242424 ..."

我相信这是因为我的数据格式不正确,但我不知道如何修改函数来处理我的数据.我的数据目前看起来像:

var data = [ {"x": 1, "y": 113},
{"x": 6, "y": 38},
{"x": 11, "y": 108},
{"x": 16, "y": 245},
{"x": 21, "y": 155},
{"x": 26, "y": 234},
...
Run Code Online (Sandbox Code Playgroud)

谢谢

javascript average d3.js

4
推荐指数
1
解决办法
6703
查看次数