Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 为什么uiwebview不显示水平滚动条?_Iphone_Uiwebview_Horizontal Scrolling - Fatal编程技术网

Iphone 为什么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

我在iphone视图中放了一个uiwebview,它的框架是0,0320460。 我使用loadHTMLString加载uiwebview。 有时我从web上获得“表宽=800…”字符串。 如果uiwebview的内容比框架宽,我想自动显示它的水平滚动条

//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的哪些属性?

它可以水平滚动吗?不,它不能水平滚动。