我的客户想要背景视图与此渐变效果 背景渐变: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)
您好开发人员我正在开发项目,我已经使用了danielgindi/Charts第三方库,现在我面临的挑战是我需要提供一个跟踪球,如图中最高点的图像所示.如何才能实现这一点? ?或者如何访问BarChart上方的值,我想在最高峰(20.0)上打印其他内容,如"E"?
我已经制作了一个演示项目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)