<tfoot id='bbC0B'></tfoot>
    1. <legend id='bbC0B'><style id='bbC0B'><dir id='bbC0B'><q id='bbC0B'></q></dir></style></legend>
        <bdo id='bbC0B'></bdo><ul id='bbC0B'></ul>

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

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

        以编程方式更改 UIImageView Xcode Swift 的高度和宽度

        Programmatically change the height and width of a UIImageView Xcode Swift(以编程方式更改 UIImageView Xcode Swift 的高度和宽度)

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

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

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

                    <tbody id='Sc3Np'></tbody>

                1. 本文介绍了以编程方式更改 UIImageView Xcode Swift 的高度和宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  嘿,由于某种原因,我正在努力尝试设置我的一个图像视图的高度和宽度.我想设置它,这样高度只占我屏幕的 20%.我知道要定期设置它,您可以执行以下操作:图像 = (0,0,50,50)

                  Hey for some reason I am struggling with trying to set the height and width of one of my image views. I want to set it so the height only goes for 20% of my screen. I know to regularly set it you can do things like: image = (0,0,50,50)

                  但我需要高度不是静态数字.像 image = (0,0, frame.height * 0.2, 50)

                  But I need the height to not be a static number. Something like image = (0,0, frame.height * 0.2, 50)

                  有什么建议吗?

                  推荐答案

                  Swift 3 中接受的答案:

                  The accepted answer in Swift 3:

                  let screenSize: CGRect = UIScreen.main.bounds
                  image.frame = CGRect(x: 0, y: 0, width: 50, height: screenSize.height * 0.2)
                  

                  这篇关于以编程方式更改 UIImageView Xcode Swift 的高度和宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  what#39;s property copy means in Cocoa#39;s Framework?(like UITabBar#39;s items property)(Cocoa 框架中的属性副本是什么意思?(如 UITabBar 的 items 属性))
                  Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)
                  How to copy a quot;Dictionaryquot; in Swift?(如何复制“字典在斯威夫特?)
                  When compiling for multiple targets in XCode, how do i ensure that certain files will not be included one target(在 XCode 中为多个目标编译时,我如何确保某些文件不会包含在一个目标中)
                  Automatically copy property values from one object to another of a different type but the same protocol (Objective-C)(自动将属性值从一个对象复制到另一个类型不同但协议相同的对象 (Objective-C))
                  Copy text to clipboard with iOS(使用 iOS 将文本复制到剪贴板)
                      <tfoot id='qbe6J'></tfoot>

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

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

                          • <small id='qbe6J'></small><noframes id='qbe6J'>