ios - 在 UIWebView 中启用关闭按钮

标签 ios xcode cocos2d-iphone

我需要在cocos2D游戏中显示webview。我使用了这段代码。但是它不显示关闭按钮,我怎样才能启用关闭按钮?这是我想要的屏幕:

enter image description here

使用的代码:

CGRect webFrame = [[UIScreen mainScreen] applicationFrame];

UIWebView* myWebView = [[[UIWebView alloc] initWithFrame:webFrame] autorelease];
myWebView.backgroundColor = [UIColor whiteColor];
myWebView.scalesPageToFit = YES;
myWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
myWebView.delegate = self;
[self.navController.view addSubview:myWebView];

[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://biggooseegg.com/moregamesscreen"]]];

其他一些疑惑:如何为这个 web view 设置圆角边框?

Here is my sample那还没有完成。

最佳答案

关闭按钮不是 UIWebView 的一部分,您必须自己添加。

可以通过在 UIWebView 后面显示所述圆角背景图像来实现圆角。您可以为此使用 CCSprite。然后使 WebView 适合背景图像。

关于ios - 在 UIWebView 中启用关闭按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11693343/

相关文章:

iphone - 基于导航的应用程序问题 - 初学者 iOS

objective-c - iOS 6 : CoreAnimation: warning, 删除了未提交 CATransaction 的线程

iphone - 在 Apple App Store 中为 Normal 和 Retina 显示器发布游戏

iPhone OpenGLES 纹理 - 色带

ios - 如何使 iOS 中 Google map 上的标记在没有动画的情况下改变其位置

ios - Swift - 减慢 "too fast"动画(UIImage 更新) - 也就是 NSTimer 是这里唯一的选择吗?

iphone - 亚马逊 S3 (AWS) NSMutableData

ios - 以编程方式使用自动布局添加多个按钮以使用 X、Y、填充约束进行查看

iphone - 使用 UINavigationController 推送 viewcontroller 有时会调用 viewDidAppear : and viewWillAppear:

cocos2d-iphone - Cocos2D 2.0 - 将 Sprite 添加到图层...中心怎么样?