我希望禁用UIWebview内部的滚动条,并根据UIWebview的宽度和高度显示内容。如果内容太大而无法在页面上显示,则应该像UILabel一样在文本末尾显示...。
Flipboard应用程序已经正确实现了这一点,在第一页上显示内容的一部分,当我们捏放缩时,根据高度和宽度显示更多内容。
如何实现这一点?任何有关此事的帮助都将不胜感激。
示例:
我正在iPad上加载此内容
我希望只显示适合在500x750框架内显示的内容。如屏幕截图所示,最后一行被切断了。
Flipboard应用程序已经正确实现了这一点,在第一页上显示内容的一部分,当我们捏放缩时,根据高度和宽度显示更多内容。
如何实现这一点?任何有关此事的帮助都将不胜感激。
示例:
我正在iPad上加载此内容
UIWebView *mWebView = [[UIWebView alloc] initWithFrame:CGRectMake(100, 100, 500, 730)];
mWebView.backgroundColor=[UIColor greenColor];
mWebView.userInteractionEnabled=YES;
mWebView.autoresizingMask=YES;
mWebView.delegate = self;
for (id subview in mWebView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).bounces = NO;
for (id subview in mWebView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).showsVerticalScrollIndicator = NO;
for (id subview in mWebView.subviews)
if ([[subview class] isSubclassOfClass: [UIScrollView class]])
((UIScrollView *)subview).scrollEnabled= NO;
[self.view addSubview:mWebView];
[mWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://mobile.washingtonpost.com/c.jsp;jsessionid=E6B119C6EF5A6274030E7B3A9F97D374?item=http%3a%2f%2fwww.washingtonpost.com%2fpolitics%2fobama-gop-leaders-said-to-discuss-new-debt-plan%2f2011%2f07%2f21%2fgIQAT81BSI_mobile.mobile&cid=578815"]]];
[mWebView release];
我希望只显示适合在500x750框架内显示的内容。如屏幕截图所示,最后一行被切断了。