2010-06-24 49 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