0

我在使用 webview 时遇到问题。这个 webview 加载了一个带有一些输入字段和一些下拉列表的网页。问题是没有出现键盘和滚轮。我看到一个快速的“闪烁”,光标确实进入了选定的输入字段,但键盘没有出现。

我正在使用 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

最后一个homeVC.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"]]];
}

我一直在寻找大约一天的时间,但这对我来说毫无意义。谁能帮我?

谢谢!

4

1 回答 1

0

也许问题出在您的网页上,因为 webview 具有标准行为,您无法对其进行修改。

于 2012-09-04T12:32:12.600 回答