Iphone 为什么uiwebview不显示水平滚动条?
我在iphone视图中放了一个uiwebview,它的框架是0,0320460。 我使用loadHTMLString加载uiwebview。 有时我从web上获得“表宽=800…”字符串。 如果uiwebview的内容比框架宽,我想自动显示它的水平滚动条Iphone 为什么uiwebview不显示水平滚动条?,iphone,uiwebview,horizontal-scrolling,Iphone,Uiwebview,Horizontal Scrolling,我在iphone视图中放了一个uiwebview,它的框架是0,0320460。 我使用loadHTMLString加载uiwebview。 有时我从web上获得“表宽=800…”字符串。 如果uiwebview的内容比框架宽,我想自动显示它的水平滚动条 //webview newsWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)]; newsWebView.delegate
//webview
newsWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
newsWebView.delegate=self;
newsWebView.backgroundColor=[UIColor clearColor];
newsWebView.opaque=NO;
newsWebView.scrollView.scrollEnabled=YES;
[newsWebView.scrollView setShowsHorizontalScrollIndicator:YES];
[newsWebView.scrollView setAlwaysBounceHorizontal:YES];
newsWebView.userInteractionEnabled=YES;
我用以下代码加载字符串:
NSString *sHTML = [NSString stringWithFormat:@"<html> \n"
"<head> \n"
"<style type=\"text/css\"> \n"
"body {font-family: \"%@\"; font-size: %@; -webkit-user-select:none;}\n"
"</style> \n"
"</head> \n"
"<body>%@</body> \n"
"</html>", DEFAULT_FONT_NAME, [NSNumber numberWithInt:webViewFontsize], body];
NSString*sHTML=[nsstringstringwithformat:@“\n”
“\n”
“\n”
正文{字体系列:\“%@\”字体大小:%@;-webkit用户选择:无;}\n
“\n”
“\n”
“%@\n”
“”,默认字体名称,[NSNumber numberWithInt:webViewFontsize],正文];
我应该设置或使用css的哪些属性?它可以水平滚动吗?不,它不能水平滚动。