【问题标题】:How to make UIView with AVCaptureVideoPreviewLayer look better?如何使带有 AVCaptureVideoPreviewLayer 的 UIView 看起来更好?
【发布时间】:2013-03-15 05:15:31
【问题描述】:

我正在尝试构建 UIView 的子类以使用 AVFoundation 快速拍摄一张快照。 它工作得很好,但我真的很想让角落变圆或添加一点阴影。 如何使用 Core Graphics 等实现这一目标?

GitHub:https://github.com/dariolass/QuickShotView

更新:结果如下:

http://www.bytolution.com/qsv.png

【问题讨论】:

    标签: ios objective-c uiview avfoundation calayer


    【解决方案1】:

    使用 QuartzCore

    #import <QuartzCore/QuartzCore.h>
    

    然后你可以修改你的视图层:

    someView.layer.cornerRadius = 8;
    someView.layer.shadowOffset = CGSizeMake(-15, 20);
    someView.layer.shadowRadius = 5;
    someView.layer.shadowOpacity = 0.5;
    

    或者类似的东西

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-02
      • 1970-01-01
      • 2012-06-18
      • 1970-01-01
      • 2021-12-30
      相关资源
      最近更新 更多