gpt4 book ai didi

objective-c - 在 Cocoa 中,使用 webview,鼠标悬停时如何在状态栏中显示链接?

转载 作者:太空狗 更新时间:2023-10-30 03:51:16 26 4
gpt4 key购买 nike

如标题所述,我正在使用 webview 显示站点,当鼠标悬停在超文本上时,我需要在状态栏中显示链接...我怎样才能做到这一点?我敢肯定这很容易,但是直到现在我还找不到任何关于此的信息...谢谢你的帮助,马西

最佳答案

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

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

另外不要忘记对您的 webView 进行 UIDelegate。和平,马西

关于objective-c - 在 Cocoa 中,使用 webview,鼠标悬停时如何在状态栏中显示链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13960734/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com