jjzjj

maskLayer

全部标签

ios - 需要有关滑动解锁的帮助,如动画

我正在使用这段代码来创建像动画一样解锁的幻灯片,但我无法让它从从右到左动画化。如何让它从右开始并向左动画?-(void)slideToCancel{CALayer*maskLayer=[CALayerlayer];//Maskimageendswith0.15opacityonbothsides.Setthebackgroundcolorofthelayer//tothesamevaluesothelayercanextendthemaskimage.maskLayer.backgroundColor=[[UIColorcolorWithRed:0.0fgreen:0.0fblue:0

ios - iPhone 7 Plus AVPlayer 周围有边框(白色颜色不匹配)

我在iPhone7Plus和iPhone6Plus上看到奇怪的行为。这不会发生在模拟器上,只会发生在物理设备上。如果您有一个AVPlayer(视频有白色背景)并且它附加到的View有一个白色背景(音频播放器小于父View),则AVPlayer周围会出现一个边框。这样做的目的是将视频融合到背景中以产生很酷的效果。除了物理Plus型号设备外,它在所有设备上都运行良好。我最好的猜测是有一些完美的白色差异。有谁知道如何解决或避免这种情况? 最佳答案 我确实遇到了这个问题,我的解决方案是将AVPlayerLayer添加到UIView容器中,并

iOS UIView 子类将透明文本绘制到背景

我想在UIView上的子类上绘制文本,以便文本从形状中切出,View后面的背景显示出来,就像在此处找到的OSXMavericksLogo一样。背景图片ViewIBOutletUIView*ViewTestIBOutletUIlabel*labelTestalpha:0样式(显示背景图片)http://s25.postimg.org/tkf1sa3x9/1122.png我会说我更像是一名中级/初级高级iOS开发人员,所以请随意向我提出一些疯狂的解决方案。我希望我必须覆盖drawRect才能执行此操作。 最佳答案 一种方法是使用图层蒙版

ios - 圆角仅适用于 UITableView 的底部边缘

我使用下面的代码只为tableView的底部边缘制作圆角CALayer*capa=self.patientTableView.layer;//RoundCGRectbounds=capa.bounds;UIBezierPath*maskPath=[UIBezierPathbezierPathWithRoundedRect:boundsbyRoundingCorners:(UIRectCornerBottomLeft|UIRectCornerBottomRight)cornerRadii:CGSizeMake(10.0,10.0)];CAShapeLayer*maskLayer=[CAS

ios - 如何设置被UIBezierPath整形的CAShapeLayer的内容

我试图在UIImageView上添加一个mask层。这个ImageView保存一个图像,mask层通过设置它的内容来保存另一个图像。但是当我将mask层添加到ImageView层时,mask层不包含任何图像。mask层已由getter初始化。添加mask层的方法如下:-(void)circleButtonClicked{self.maskLayer.contents=(id)[UIImageimageNamed:@"mask.jpg"].CGImage;self.maskLayer.frame=CGRectMake(0,0,kSCREEN_WIDTH,kSCREEN_WIDTH);se

objective-c - UITableView 滚动时中断?

我刚刚意识到,如果我使用此代码仅将我的UITableView的前2条边倒圆角:UIBezierPath*maskPath=[UIBezierPathbezierPathWithRoundedRect:thetableView.boundsbyRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRightcornerRadii:CGSizeMake(10.0,10.0)];//CreatetheshapelayerandsetitspathCAShapeLayer*maskLayer=[CAShapeLayerlayer];maskLay

ios - 使用 UIBezierPath 和阴影查看?

我在UITableViewCell中有一个View,它有3个圆角和一个阴影。我正在使用UIBezierPath处理圆角,但我无法删除阴影。这是使用的代码行:CGRectbounds2=cell.backgroundMessageView.bounds;UIBezierPath*maskPath2=[UIBezierPathbezierPathWithRoundedRect:bounds2byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight|UIRectCornerBottomRightcornerRadii:CGSizeM

ios - Swift - 分组样式 TableView 设计

我正在尝试在Xcode6.3中设计分组样式的TableView。我没有像下面附上的第二张图片那样覆盖table的矩形框。你能告诉我如何构建一个像第二个那样的屏幕吗? 最佳答案 这里以iOS7为例:https://github.com/yesidi/YipPrettyTableViewCell编辑:我使用Swift制作了一个简单的单元格。//GroupedTableViewCell.swiftimportUIKitletRADIUS:CGFloat=5letInsetX:CGFloat=20enumCellPosition:Int{c

ios - UIView 圆角 - Swift 2.0?

我会尝试将一些项目更新到Swift2.0。我有一个View,左上角有一个圆角。在Swift没有警告,没有错误,只是没有圆角。这是它在SwiftletmaskPath=UIBezierPath(roundedRect:contentView.bounds,byRoundingCorners:.TopLeft,cornerRadii:CGSize(width:10.0,height:10.0))letmaskLayer=CAShapeLayer(layer:maskPath)maskLayer.frame=contentView.boundsmaskLayer.path=maskPath.

iphone - UIBezierPath 不绘制圆底角

我正在尝试为我的View制作圆角并解决一个奇怪的问题。我使用以下代码为我的View制作圆角bezierPath=[UIBezierPathbezierPathWithRoundedRect:btnView.boundsbyRoundingCorners:UIRectCornerAllCornerscornerRadii:radius];CAShapeLayer*maskLayer=[[CAShapeLayeralloc]init];maskLayer.frame=btnView.bounds;maskLayer.path=bezierPath.CGPath;btnView.layer.