5

正如标题所说,我正在使用 webview 来显示一个网站,当鼠标悬停在超文本上时,我需要在状态栏中显示链接......我该怎么做?我敢肯定这很容易,但到目前为止我找不到任何关于这个的东西......谢谢你的帮助,Massy

4

1 回答 1

6

我知道了!我很确定这很容易......这是我为遇到同样问题的任何人所做的:

-(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);
}

也不要忘记 UIDelegate 你的 webView。和平,马西

于 2012-12-20T14:29:23.767 回答