<bdo id='0Gzg2'></bdo><ul id='0Gzg2'></ul>

  1. <legend id='0Gzg2'><style id='0Gzg2'><dir id='0Gzg2'><q id='0Gzg2'></q></dir></style></legend>

      <small id='0Gzg2'></small><noframes id='0Gzg2'>

      <i id='0Gzg2'><tr id='0Gzg2'><dt id='0Gzg2'><q id='0Gzg2'><span id='0Gzg2'><b id='0Gzg2'><form id='0Gzg2'><ins id='0Gzg2'></ins><ul id='0Gzg2'></ul><sub id='0Gzg2'></sub></form><legend id='0Gzg2'></legend><bdo id='0Gzg2'><pre id='0Gzg2'><center id='0Gzg2'></center></pre></bdo></b><th id='0Gzg2'></th></span></q></dt></tr></i><div id='0Gzg2'><tfoot id='0Gzg2'></tfoot><dl id='0Gzg2'><fieldset id='0Gzg2'></fieldset></dl></div>
    1. <tfoot id='0Gzg2'></tfoot>
    2. 如何在椭圆形或圆形上裁剪 UIImage?

      时间:2023-10-03

        <bdo id='4tFtY'></bdo><ul id='4tFtY'></ul>

          <i id='4tFtY'><tr id='4tFtY'><dt id='4tFtY'><q id='4tFtY'><span id='4tFtY'><b id='4tFtY'><form id='4tFtY'><ins id='4tFtY'></ins><ul id='4tFtY'></ul><sub id='4tFtY'></sub></form><legend id='4tFtY'></legend><bdo id='4tFtY'><pre id='4tFtY'><center id='4tFtY'></center></pre></bdo></b><th id='4tFtY'></th></span></q></dt></tr></i><div id='4tFtY'><tfoot id='4tFtY'></tfoot><dl id='4tFtY'><fieldset id='4tFtY'></fieldset></dl></div>
              <tbody id='4tFtY'></tbody>

              <tfoot id='4tFtY'></tfoot>
            1. <small id='4tFtY'></small><noframes id='4tFtY'>

            2. <legend id='4tFtY'><style id='4tFtY'><dir id='4tFtY'><q id='4tFtY'></q></dir></style></legend>

                本文介绍了如何在椭圆形或圆形上裁剪 UIImage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                请给出如何在椭圆形或圆形上裁剪 UIImage 的想法.请分享您的想法.

                Please give ideas for how to crop UIImage on oval shape or circle shape. Please share your ideas.

                推荐答案

                #import <QuartzCore/QuartzCore.h>
                
                CALayer *imageLayer = YourImageview.layer;
                        [imageLayer setCornerRadius:5];
                        [imageLayer setBorderWidth:1];
                        [imageLayer setMasksToBounds:YES];
                

                通过增加半径,它会变得更圆.

                by increasing radius it will become more round-able.

                只要图片是正方形,取一半宽度作为圆角半径就可以得到一个正圆:

                As long as the image is a square, you can get a perfect circle by taking half the width as the corner radius:

                [imageView.layer setCornerRadius:imageView.frame.size.width/2]; 
                

                你还需要添加

                [imageView.layer setMasksToBounds:YES];
                

                斯威夫特 4.2

                import QuartzCore
                
                var imageLayer: CALayer? = YourImageview.layer
                imageLayer?.cornerRadius = 5
                imageLayer?.borderWidth = 1
                imageLayer?.masksToBounds = true
                

                这篇关于如何在椭圆形或圆形上裁剪 UIImage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:iOS 4 应用程序在 iOS 3.1.3 上启动时崩溃:找不到符号:__NSConcreteStackBlock 下一篇:如果安装了应用程序,如何以编程方式检查?

                相关文章

              • <tfoot id='0FqEA'></tfoot>

                1. <i id='0FqEA'><tr id='0FqEA'><dt id='0FqEA'><q id='0FqEA'><span id='0FqEA'><b id='0FqEA'><form id='0FqEA'><ins id='0FqEA'></ins><ul id='0FqEA'></ul><sub id='0FqEA'></sub></form><legend id='0FqEA'></legend><bdo id='0FqEA'><pre id='0FqEA'><center id='0FqEA'></center></pre></bdo></b><th id='0FqEA'></th></span></q></dt></tr></i><div id='0FqEA'><tfoot id='0FqEA'></tfoot><dl id='0FqEA'><fieldset id='0FqEA'></fieldset></dl></div>

                  <small id='0FqEA'></small><noframes id='0FqEA'>

                    <bdo id='0FqEA'></bdo><ul id='0FqEA'></ul>
                  1. <legend id='0FqEA'><style id='0FqEA'><dir id='0FqEA'><q id='0FqEA'></q></dir></style></legend>