Blu*_*lue 5 cocoa objective-c mouseover webview
正如标题所说,我正在使用webview来显示网站,当鼠标悬停在超文本上时我需要在状态栏中显示链接...我该怎么做?我相信这是非常容易的事情,但到目前为止我找不到任何关于此事的内容......感谢任何帮助,Massy
我知道了!我很确定它太容易了...这就是我为那些遇到同样问题的人所做的事情:
-(void)webView:(WebView *)sender mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(unsigned int)modifierFlags
{
NSArray* keys = [elementInformation objectForKey:WebElementLinkURLKey];
//here I pass the link to a label
if (keys != nil) [statusBarLabel setStringValue:[NSString stringWithFormat:@"%@",keys]];
else [statusBarLabel setStringValue:@""];
// NSLog(@"%@",keys);
}
Run Code Online (Sandbox Code Playgroud)
另外不要忘记UIDelegate你的webView.和平,马西
| 归档时间: |
|
| 查看次数: |
536 次 |
| 最近记录: |