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

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

        • <bdo id='0uryO'></bdo><ul id='0uryO'></ul>
        <tfoot id='0uryO'></tfoot>

        无法转换类型 '() -&gt; 的值_' 指定类型 UIImageView

        时间:2024-04-14
          <tbody id='ujH0s'></tbody>

        <small id='ujH0s'></small><noframes id='ujH0s'>

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

                  <bdo id='ujH0s'></bdo><ul id='ujH0s'></ul>

                  <legend id='ujH0s'><style id='ujH0s'><dir id='ujH0s'><q id='ujH0s'></q></dir></style></legend>
                • 本文介绍了无法转换类型 '() -&gt; 的值_' 指定类型 UIImageView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使 UIImage 视图可点击,但我没有运气.完成这项任务的最佳方法是什么?我得到的错误是无法将类型 '() -> _' 的值转换为指定类型 'UIImageView'".

                  I am trying to make a UIImage view clickable, but I am having no luck. What is the best way to complete this task? The error I am getting is "Cannot convert value of type '() -> _' to specified type 'UIImageView'".

                  lazy var profileImageView: UIImageView = {
                       let imageView = UIImageView()
                       imageView.image = UIImage(named: "ic_file_upload_white_48pt")
                       imageView.translatesAutoresizingMaskIntoConstraints = false
                       imageView.contentMode = .scaleAspectFill
                  
                       imageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleSelectorProfileImage)))
                       imageView.isUserInteractionEnabled = true
                       return imageView
                   }
                  

                  推荐答案

                  好像是语法问题,试试

                  func profileImageView() -> UIImageView {
                          let imageView = UIImageView()
                          imageView.image = UIImage(named: "ic_file_upload_white_48pt")
                          imageView.translatesAutoresizingMaskIntoConstraints = false
                          imageView.contentMode = .scaleAspectFill
                  
                          imageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleSelectorProfileImage)))
                          imageView.isUserInteractionEnabled = true
                          return imageView
                  }
                  

                  这篇关于无法转换类型 '() -&gt; 的值_' 指定类型 UIImageView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 UITableView 中将 UITableViewCell 图像更改为圆形 下一篇:你如何知道在 touchesBegan 中被触摸的对象是什么?

                  相关文章

                    <bdo id='Nx3gR'></bdo><ul id='Nx3gR'></ul>

                • <legend id='Nx3gR'><style id='Nx3gR'><dir id='Nx3gR'><q id='Nx3gR'></q></dir></style></legend>
                • <i id='Nx3gR'><tr id='Nx3gR'><dt id='Nx3gR'><q id='Nx3gR'><span id='Nx3gR'><b id='Nx3gR'><form id='Nx3gR'><ins id='Nx3gR'></ins><ul id='Nx3gR'></ul><sub id='Nx3gR'></sub></form><legend id='Nx3gR'></legend><bdo id='Nx3gR'><pre id='Nx3gR'><center id='Nx3gR'></center></pre></bdo></b><th id='Nx3gR'></th></span></q></dt></tr></i><div id='Nx3gR'><tfoot id='Nx3gR'></tfoot><dl id='Nx3gR'><fieldset id='Nx3gR'></fieldset></dl></div>

                  <tfoot id='Nx3gR'></tfoot>
                  1. <small id='Nx3gR'></small><noframes id='Nx3gR'>