yoki's recent timeline updates
yoki

yoki

V2EX member #37912, joined on 2013-04-21 21:50:59 +08:00
yoki's recent replies
你好 之前也遇到过这样的问题 来说一下我的解决办法

自动布局是会在更新视图的时候同步更新frame bounds的 然而有时候我们在代码中获取的时候却得到{(0,0),(0,0)} 或者各种奇怪的结果 这是因为在你用代码获取frame的时候系统还没有更新你的layout

楼上的朋友@dorentus 提供的解决方案应该是可行的 因为在viewWillAppear中一般的视图都更新完layout了 应该是可以获取到的

但是有时候我们想在任意函数中获取怎么办呢

解决方案是在获取之前加上一句[myDemoView layoutIfNeeded];



```
[myDemoView layoutIfNeeded];

NSLog("frame:%@",NSStringFromRect(myDemoView.frame));
```

这个回复是我在PC上打的 拼写也许有错误 希望能帮到你
分享解决了我这个问题的一个帖子:
If you open the Activity Monitor and see that a process called "google chrome helper" is using too much CPU, here's how I fixed it:

I went to Chrome settings/content settings/Plugins and selected Click To Play for all plugins. (The default is Run Automatically.)

This fixed my problem. Now you have to click whenever you want to run a youtube video or other plugins, but it's worth it. It stops those stupid Flash ads from loading, too, so that's an extra bonus.

I'm posting this because when I had the problem, I couldn't find any solutions at all.

就是隐私下面那个“内容设置”点进去 将插件设置成点击运行就好 flash的广告也顺带屏蔽了
我的chrome已经这样好久了 最近发现iPhoto也出现了这样的问题 看来是系统的bug
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5969 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 03:27 · PVG 11:27 · LAX 20:27 · JFK 23:27
♥ Do have faith in what you're doing.