小编Har*_*oel的帖子

background Gradient:在物镜C中从左到右线性

我的客户想要背景视图与此渐变效果 背景渐变:rgb(118,118,118)| #ffffff | rgb(198,198,197)线性从左到右 我试过这种方式但它发生在垂直方向我希望它以水平方式

UIColor *leftColor = [UIColor colorWithRed:118.0/255.0 green:118.0/255.0 blue:118.0/255.0 alpha:1.0];
UIColor *middleColor = [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0];
UIColor *rightColor = [UIColor colorWithRed:198.0/255.0 green:198.0/255.0 blue:197.0/255.0 alpha:1.0];

// Create the gradient
CAGradientLayer *theViewGradient = [CAGradientLayer layer];
theViewGradient.colors = [NSArray arrayWithObjects: (id)leftColor.CGColor, (id)middleColor.CGColor,(id)rightColor.CGColor, nil];
theViewGradient.frame = self.view.bounds;
//Add gradient to view
[self.view.layer insertSublayer:theViewGradient atIndex:0];
Run Code Online (Sandbox Code Playgroud)

像这样 ?? 在此输入图像描述

objective-c ios cagradientlayer

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

如何在Swift 3x的条形图上的Bar上方实现轨迹球和访问标签

您好开发人员我正在开发项目,我已经使用了danielgindi/Charts第三方库,现在我面临的挑战是我需要提供一个跟踪球,如图中最高点的图像所示.如何才能实现这一点? ?或者如何访问BarChart上方的值,我想在最高峰(20.0)上打印其他内容,如"E"?

在此输入图像描述 在此输入图像描述

charts objective-c bar-chart swift ios-charts

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

如何在iOS Swift中获取应用程序的CFBundleURLSchemes

我已经制作了一个演示项目App1,其中我添加了一个按钮,它将重定向到安装的应用程序假设App2(" fitbit ")我已经通过了很多教程,基本上知道如何通过第二个答案"这个应用程序不允许查询方案cydia"IOS9错误.但是我需要在App1中的LSApplicationQueriesSchemes中提到App2的URL方案(" fitbit ").

在此输入图像描述

所以基本上问题是如何获得像fitbit这样的应用程序的URL Schemes .

在此输入图像描述

这是我的代码

var url  = NSURL(string: "itms://itunes.apple.com/in/app/fitbit/id462638897?mt=8")
@IBAction func redirectOnclick(_ sender: Any) {
        let urlFitBt  = NSURL(string: "fitbit://")
        if UIApplication.shared.canOpenURL(urlFitBt! as URL)
        {
            UIApplication.shared.open(urlFitBt! as URL)
        }
        else
        {
            UIApplication.shared.open(url! as URL)

        }

    }
Run Code Online (Sandbox Code Playgroud)

objective-c url-scheme ios fitbit swift

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