1
블로그에서 웹 콘텐츠를로드하는 작은 응용 프로그램에서 UIWebView (스크롤 할 수있는 UIScrollView 내부)는 모든 콘텐츠를 뷰가 실제의 UIScrollView의 프레임보다 긴 경우를 표시합니다. 여기에 문제의 이미지는 다음과 같습니다UIScrollView 내의 UIWebView 프레임이 모든 내용에 맞게 크기가 확장되지 않습니다.
있는 UIScrollView하고있는 UIWebView를 애플의 문서에서
- (id)initWithHTML:(NSString*)html
{
self = [super init];
if (self) {
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
UIScrollView* v = [[UIScrollView alloc] initWithFrame:appFrame];
self.view = v;
UIWebView* webView = [[UIWebView alloc] initWithFrame:v.frame];
webView.userInteractionEnabled = NO;
webView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:webView];
[webView loadHTMLString:html baseURL:nil];
CGSize sz = v.bounds.size;
sz.height = webView.bounds.size.height + 20;
v.contentSize = sz;
[v release];
[webView release];
}
return self;
}
아직도 기본을 배우는 사람, 고마워. 너 락. 보기는 이제 의도 한대로 작동합니다. – rnystrom