I have an application that uses UIWebView on one of the tabs. Everything works as it should, but the speed that the scroll views is very slow! It doesn't matter if I'm building it in a simulator, or if I build it on my iPhone, it's the same slow scrolling. How to increase the scroll speed of a view? I noticed that it will stop scrolling as soon as the finger leaves the screen, instead of continuing to scroll and slow down, like on a safari, does this have anything to do with it?
This is my .h file:
#import <UIKit/UIKit.h>
@interface FirstViewController_SE : UIViewController<UIWebViewDelegate> {
IBOutlet UIWebView *webDisplay_SE;
UIBarButtonItem* mBack;
UINavigationItem* back;
}
@property(nonatomic,retain) UIWebView *webDisplay_SE;
@property (nonatomic, retain) IBOutlet UIBarButtonItem* back;
- (void)updateButtons;
@end
And this is my .m file:
#import "FirstViewController_SE.h"
@interface FirstViewController_SE ()
@end
@implementation FirstViewController_SE;
@synthesize webDisplay_SE;
@synthesize back = mBack;
#pragma mark - View lifecycle
- (void)viewDidLoad {
[super viewDidLoad];
self.webDisplay_SE.delegate = self;
NSString *urlAddress = @"http://www.safeline.eu/mobile/se/product";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webDisplay_SE loadRequest:requestObj];
[self updateButtons];
}
- (void)viewDidUnload {
self.back = nil;
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void)updateButtons
{
self.back.enabled = self.webDisplay_SE.canGoBack;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
- (BOOL)webDisplay_SE:(UIWebView *)webDisplay_SE shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return YES;
}
- (void)webViewDidStartLoad:(UIWebView *)webDisplay_SE
{
[self updateButtons];
}
- (void)webViewDidFinishLoad:(UIWebView *)webDisplay_SE
{
[self updateButtons];
}
@end
source
share