我加載網頁視圖,並設置allowsScrolling爲NO,但仍然web視圖顯示滾動條...您的電腦上敲打你的頭以上,現在MacBook有鋒利的金屬邊緣傷害了很多。可可的WebView滾動條不會消失
我的代碼:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
NSString *webFolder = @"file:///<WebFolderPath>";
[[[productWeb mainFrame] frameView] setAllowsScrolling:NO];
[productWeb setFrameLoadDelegate:self];
[[productWeb mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[webFolder stringByAppendingString:@"webpage.html"]]]];
}
我甚至安裝框架加載代表報告有關滾動狀態:
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
NSLog(@"Scrolling %@",[[frame frameView] allowsScrolling] ? @"Allowed" : @"Not Allowed");
[[frame frameView] setAllowsScrolling:NO];
NSLog(@"Scrolling %@",[[frame frameView] allowsScrolling] ? @"Allowed" : @"Not Allowed");
}
仍然給了我不爽:
2010-08-24 15:20:09.102 myApp[30437:a0f] Scrolling Allowed
2010-08-24 15:20:09.104 myApp[30437:a0f] Scrolling Not Allowed
而且但滾動條繼續顯示!希望這是愚蠢的,因爲我不想在筆記本電腦上獲得更多血液。
我覺得這是OS X,雖然沒有iOS版... – Wevah 2010-08-25 02:39:45
啊,好點 - 我必須有iPhone的大腦。 – Don 2010-08-25 15:32:50
是的,最近iPhone框架似乎越來越受到關注。我很想看到帶到核心可可的許多功能。 – BadPirate 2010-08-25 21:59:59