<legend id='mrNR6'><style id='mrNR6'><dir id='mrNR6'><q id='mrNR6'></q></dir></style></legend>

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

      • <bdo id='mrNR6'></bdo><ul id='mrNR6'></ul>
      1. <tfoot id='mrNR6'></tfoot>
      2. iOS 无法更改 UIButton 的框架

        iOS cannot change frame of UIButton(iOS 无法更改 UIButton 的框架)

        <tfoot id='P9CQc'></tfoot>

          <tbody id='P9CQc'></tbody>

          • <bdo id='P9CQc'></bdo><ul id='P9CQc'></ul>

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

              1. <i id='P9CQc'><tr id='P9CQc'><dt id='P9CQc'><q id='P9CQc'><span id='P9CQc'><b id='P9CQc'><form id='P9CQc'><ins id='P9CQc'></ins><ul id='P9CQc'></ul><sub id='P9CQc'></sub></form><legend id='P9CQc'></legend><bdo id='P9CQc'><pre id='P9CQc'><center id='P9CQc'></center></pre></bdo></b><th id='P9CQc'></th></span></q></dt></tr></i><div id='P9CQc'><tfoot id='P9CQc'></tfoot><dl id='P9CQc'><fieldset id='P9CQc'></fieldset></dl></div>
                <legend id='P9CQc'><style id='P9CQc'><dir id='P9CQc'><q id='P9CQc'></q></dir></style></legend>
                • 本文介绍了iOS 无法更改 UIButton 的框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前遇到一个非常奇怪的问题.我正在使用 iOS 6 和 Xcode 4.5.我有一个带有 UIViewControllerUIButton 的情节提要.我为我的 .h 文件制作了一个弱 UIButton 出口.

                  I am currently stuck with a very weird problem. I am using iOS 6 and Xcode 4.5. I have a storyboard with a UIViewController and a UIButton in it. I made a weak UIButton outlet to my .h file.

                  在 .m 文件中,我想更改按钮的框架,但没有任何反应.然而,我创建了一个 UIImageView,并以与 UIButton 相同的方式连接,但我可以毫无问题地更改 UIImageView 的框架.

                  In the .m file I want to change the frame of the button but nothing happens. Yet I have an UIImageView created and connected the same way as the UIButton but I can change the UIImageView's frame without any problems.

                  当我这样做时:

                  NSLog(@"%@", button) 
                  

                  我得到这个输出:

                  <UIButton: 0xa185a40; frame = (191 330; 73 44); opaque = NO; autoresize = TM+BM; layer = <CALayer: 0xa185640>>
                  

                  这些是我的代码的相关部分:

                  And these are the relevant parts of my code:

                  -(void)viewDidLayoutSubviews{
                      [self addStampGrid];
                  }
                  
                  -(void)addStampGrid {
                  
                      // ...
                  
                      [_button setFrame:CGRectMake(10,10,10,10)];
                  }
                  

                  推荐答案

                  我在使用 XCode 4.5 和 iOS 6 作为部署目标时遇到了同样奇怪的问题.我没有使用故事板.我设法通过禁用界面生成器中的使用自动布局"选项来解决它.(在文件检查器->界面生成器文档中.

                  I had the same weird problem using XCode 4.5 and iOS 6 as deployment target. I am not using story board though. I managed to solve it by disabling the option "Use Autolayout" in the Interface Builder. (In the file inspector->Interface builder document.

                  希望对你有帮助

                  这篇关于iOS 无法更改 UIButton 的框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  UIButton title text color(UIButton 标题文本颜色)
                  Stretch background image for UIButton(为 UIButton 拉伸背景图像)
                  Using Tint color on UIImageView(在 UIImageView 上使用 Tint 颜色)
                  How can I change UIButton title color?(如何更改 UIButton 标题颜色?)
                  iPhone UIButton - image position(iPhone UIButton - 图像位置)
                  UIButton remove all target-actions(UIButton 删除所有目标动作)
                    <tbody id='W8rDy'></tbody>

                      <legend id='W8rDy'><style id='W8rDy'><dir id='W8rDy'><q id='W8rDy'></q></dir></style></legend>
                    • <small id='W8rDy'></small><noframes id='W8rDy'>

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