小编Per*_*rry的帖子

iOS 7.0中的水平CAGradientLayer

在我的应用程序中,我使用a CAGradientLayer来设置我的单元格的背景,这样:

retValue = [tableView dequeueReusableCellWithIdentifier:@"Cells" forIndexPath:indexPath];
UIView *bgColorView = [[UIView alloc] init];
bgColorView.backgroundColor = [UIColor blueColor];
bgColorView.layer.masksToBounds = YES;
id startColor = (id)[[UIColor colorWithWhite:0.75 alpha:1] CGColor];
id endColor = (id)[[UIColor blueColor] CGColor];
CAGradientLayer* gradientLayer = [CAGradientLayer layer];
gradientLayer.frame = retValue.contentView.bounds;
gradientLayer.colors = @[startColor,startColor,endColor,endColor];
gradientLayer.locations = @[[NSNumber numberWithFloat:0],
    [NSNumber numberWithFloat:0.95],
    [NSNumber numberWithFloat:0.95],
    [NSNumber numberWithFloat:1]];
[gradientLayer setStartPoint:CGPointMake(0,0.5)];
[gradientLayer setEndPoint:CGPointMake(1,0.5)];
[bgColorView.layer addSublayer:gradientLayer];
retValue.selectedBackgroundView = bgColorView;
Run Code Online (Sandbox Code Playgroud)

(此代码在里面- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath)

它在iOS 6上工作正常但在iOS 7上不起作用,在新的iOS中,渐变始终是垂直的(忽略startPoint和endPoint)

有没有人在同一个问题上遇到过?

谢谢,

佩里

ios cagradientlayer

21
推荐指数
2
解决办法
1万
查看次数

强制HttpWebRequest发送客户端证书

我有一个p12证书,我以这种方式加载它:

X509Certificate2 certificate = new X509Certificate2(certName, password,
        X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet |
        X509KeyStorageFlags.Exportable);
Run Code Online (Sandbox Code Playgroud)

它是正确加载的,实际上如果我这样做certificate.PrivateKey.ToXmlString(true);会返回一个完整的xml而不会出错.但如果我这样做:

try
{
    X509Chain chain = new X509Chain();
    var chainBuilt = chain.Build(certificate);
    Console.WriteLine("Chain building status: "+ chainBuilt);

    if (chainBuilt == false)
        foreach (X509ChainStatus chainStatus in chain.ChainStatus)
            Console.WriteLine("Chain error: "+ chainStatus.Status);
}
catch (Exception ex)
{
    Console.WriteLine(ex);
}
Run Code Online (Sandbox Code Playgroud)

它写道:

Chain building status: False
Chain error: RevocationStatusUnknown 
Chain error: OfflineRevocation 
Run Code Online (Sandbox Code Playgroud)

所以当我这样做时:

        ServicePointManager.CheckCertificateRevocationList = false;
    ServicePointManager.ServerCertificateValidationCallback = (a, b, c, d) => true;
    ServicePointManager.Expect100Continue = true;
    Console.WriteLine("connessione a:" + …
Run Code Online (Sandbox Code Playgroud)

c# httpwebrequest x509certificate

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

显示来自基于单词的建议和自己的完成提供程序的结果

我正在开发一个 Visual Studio Code 扩展,它使用语言服务器协议提供一个完成列表。我的问题是,实施后,用户已经失去了根据文档内容完成的内容。

我希望补全显示自己的提供商的结果以及 VSCode 基于单词的建议。

非工作示例:

工作示例:

https://github.com/APerricone/harbourCodeExtension/issues/16

我尝试设置isIncompletefalse,但没有任何改善。

visual-studio-code vscode-extensions

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