【问题标题】:uibutton setframe not working no auto layaout enableduibutton setframe不工作没有启用自动布局
【发布时间】:2013-05-04 23:10:29
【问题描述】:

我有一个 uibutton,我想根据设备更改它的位置,但是这段代码:

[self.notification setFrame:CGRectMake(12, 495, 17, 18)];

根本不工作!未启用自动布局。有什么想法吗?

任何帮助表示赞赏。

【问题讨论】:

  • 在程序的同一点尝试NSLog(@"%@", self.notification)。我敢打赌它是零。
  • 我得到了这个:>
  • 所以您的代码运行良好!和你说的一模一样!
  • 那它为什么不动!!!!
  • 因为它已经存在了!

标签: objective-c uibutton cgrectmake


【解决方案1】:

问题是你正在移动的按钮,self.notification 是不可见的;您已将其 hidden 设置为 YES。所以它在移动,但你看不到它移动,因为你根本看不到它。也许它不是你想的那个按钮!

【讨论】:

  • 每个人都遇到过这种情况。 :)
猜你喜欢
  • 2014-11-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-13
  • 2015-09-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-21
相关资源
最近更新 更多