0
我遇到了一個web視圖的問題。這個webview加載一個網頁,其中包含一些輸入字段和一些列表。問題在於鍵盤和滾輪沒有出現。我看到一個快速的「閃光燈」,光標確實進入了所選擇的輸入區域,但鍵盤沒有出現。Iphone鍵盤和滾輪沒有出現
我使用的Xcode 4.3.3
我Appdelegate.h
#import <UIKit/UIKit.h>
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate> {
UIWindow *windowTB;
UIViewController *tabBarVC;
// UIWebView *homeWebView;
}
@property (strong, nonatomic) IBOutlet UIWindow *windowTB;
@property (strong, nonatomic) IBOutlet UIViewController *tabBarVC;
//@property (strong, nonatomic) IBOutlet UIWebView *homeWebView;
@end
Appdelegate.m(相關部分)
#import "AppDelegate.h"
#import "tabBarVC.h"
#import "homeVC.h"
@implementation AppDelegate
@synthesize windowTB;
@synthesize tabBarVC;
//@synthesize homeWebView;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self.windowTB setRootViewController:tabBarVC];
[self.windowTB makeKeyAndVisible];
return YES;
}
的homeVC.h
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface homeVC : UIViewController <UIWebViewDelegate>{
IBOutlet UIWebView *homeWebView;
}
@property (nonatomic, retain) UIWebView *homeWebView;
@end
最後的回家VC.m
#import "AppDelegate.h"
#import "homeVC.h"
@implementation homeVC
@synthesize homeWebView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
return self;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidLoad
{
[super viewDidLoad];
[homeWebView loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:@"http://rolfdeenen.nl/test.html"]]];
}
我一直在尋找大約一天的時間,但它只是對我沒有興趣。誰能幫我?
Thanx!
我的網頁只是一個標準的測試網頁,http://rolfdeenen.nl/test.html這裏沒有什麼特別的。還是有什麼缺失? – Rolfie
我已將網站更改爲谷歌,但問題仍然存在 – Rolfie
您是否爲您的webview設置了'userInteractionEnabled = YES'? – Fry