2010-06-24 79 views
0
CGRect fullFrame = CGRectMake(10, 150, 300, 200); 

UIWebView *fullTextView = [[UIWebView alloc] initWithFrame:fullFrame]; 
fullTextView.userInteractionEnabled = YES; 

NSString *imagePath = [[MDImageManager sharedImageManager].imagesPath copy]; 
imagePath = [imagePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"]; 
imagePath = [imagePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; 
NSString *imageName = [[MDImageManager sharedImageManager] loadImage:[NSURL URLWithString:currentCoupon.fullImageURL]]; 
NSString *HTMLData = [NSString stringWithFormat: @"<img src=%@ />", imageName]; 

[fullTextView loadHTMLString:HTMLData baseURL:[NSURL URLWithString: [NSString stringWithFormat:@"file:/%@//",imagePath]]]; 

[view addSubview:fullTextView]; 

图像加载并显示,但Web视图没有滚动条!UIWebView不显示iPhone模拟器上的滚动条

fullTextView被添加到视图控制器,包含在导航+标签栏视图控制器,它可能是问题吗?

任何帮助非常感谢!

杰拉德

回答

0

这不是导航或tabbar问题。

uiwebview包含一个uiscrollview作为provate属性,并且您无法正常访问它。

您可以通过黑客组件查找UIScrollview子视图或直接使用自己的UIScrollView来找到UiscrollView,它有scrollIndicators方法。您可以参考这个帖子: How to show UIWebView's scroll indicators