Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift2 在swift 2.0中添加全边框和仅右下角短号半径_Swift2_Ios9_Xcode7 - Fatal编程技术网

Swift2 在swift 2.0中添加全边框和仅右下角短号半径

Swift2 在swift 2.0中添加全边框和仅右下角短号半径,swift2,ios9,xcode7,Swift2,Ios9,Xcode7,我想在我的UIView中添加只有左下角半径的边框。我正在使用以下代码来实现所需的结果,但正在工作,我是swift的新手 var layer = CAShapeLayer() layer.bounds = self.myView.bounds layer.borderColor = UIColor.whiteColor().CGColor layer.borderWidth = 2 callayer.path = UIBezierPath(roundedRect

我想在我的UIView中添加只有左下角半径的边框。我正在使用以下代码来实现所需的结果,但正在工作,我是swift的新手

var layer = CAShapeLayer()
    layer.bounds = self.myView.bounds

    layer.borderColor = UIColor.whiteColor().CGColor
    layer.borderWidth = 2

    callayer.path = UIBezierPath(roundedRect: self.imgView.bounds, byRoundingCorners: [.BottomRight], cornerRadii: CGSize(width: 20, height: 20)).CGPath
    self.myView.layer.mask = layer
结果

我不熟悉斯威夫特。我怎样才能同时拥有我的UIView的一个corder半径和边界

    self.myView.layer.borderWidth = 2.0
   self.myView.layer.borderColor = UIColor.whiteColor().CGColor
   self.myView.layer.cornerRadius =  /*floatvalue*/
或者你想要一个圆形视图

 self.myView.layer.cornerRadius =  self.myView.frame.size.width/2