yoki 最近的时间轴更新
yoki

yoki

V2EX 第 37912 号会员,加入于 2013-04-21 21:50:59 +08:00
yoki 最近回复了
你好 之前也遇到过这样的问题 来说一下我的解决办法

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

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

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

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



```
[myDemoView layoutIfNeeded];

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

这个回复是我在PC上打的 拼写也许有错误 希望能帮到你
2014-02-15 15:39:24 +08:00
回复了 family 创建的主题 macOS 你们的10.9是不是也有一个google chrome helper的无响应进程?
分享解决了我这个问题的一个帖子:
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的广告也顺带屏蔽了
2014-02-03 11:20:21 +08:00
回复了 nigelvon 创建的主题 macOS 更新Chrome 31.0.1650.57 For Mac之后,双指和滚轮翻页经常失效
我的chrome已经这样好久了 最近发现iPhoto也出现了这样的问题 看来是系统的bug
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2878 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 14:30 · PVG 22:30 · LAX 07:30 · JFK 10:30
Developed with CodeLauncher
♥ Do have faith in what you're doing.