始终在uiwebview上显示垂直和水平滚动指示器

时间:2022-09-06 20:47:24

i get html text and images from web services and load in webview. i need to add scroll indicator for vertical and horizontal scroll bar for view text and images. some of the large text and images user didn't notice full information. shown scroll indicators after finish loading webview

我从Web服务获取html文本和图像,并加载到webview中。我需要为视图文本和图像添加垂直和水平滚动条的滚动指示器。一些大文本和图像用户没有注意到完整的信息。完成加载webview后显示滚动指示器

1 个解决方案

#1


0  

Starting iOS 5.0 onwards, you can customize the scrolling behavior of UIWebView by accessing the 'scrollview' property to achieve the desired functionality:

从iOS 5.0开始,您可以通过访问“scrollview”属性来自定义UIWebView的滚动行为,以实现所需的功能:

Use the scroll view of the webview like this:

使用webview的滚动视图,如下所示:

[webView.scrollView setShowsHorizontalScrollIndicator:YES]; [webView.scrollView setShowsVerticalScrollIndicator:YES];

[webView.scrollView setShowsHorizo​​ntalScrollIndicator:YES]; [webView.scrollView setShowsVerticalScrollIndicator:YES];

You can do one thing that ,use this

你可以做一件事,使用它

  • (void) webViewDidFinishLoad:(UIWebView *)webView){

    (void)webViewDidFinishLoad:(UIWebView *)webView){

    [webView.scrollView flashScrollIndicators];
    

    }

    }

can set indicator color as -

可以将指示颜色设置为 -

webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;

webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;

#1


0  

Starting iOS 5.0 onwards, you can customize the scrolling behavior of UIWebView by accessing the 'scrollview' property to achieve the desired functionality:

从iOS 5.0开始,您可以通过访问“scrollview”属性来自定义UIWebView的滚动行为,以实现所需的功能:

Use the scroll view of the webview like this:

使用webview的滚动视图,如下所示:

[webView.scrollView setShowsHorizontalScrollIndicator:YES]; [webView.scrollView setShowsVerticalScrollIndicator:YES];

[webView.scrollView setShowsHorizo​​ntalScrollIndicator:YES]; [webView.scrollView setShowsVerticalScrollIndicator:YES];

You can do one thing that ,use this

你可以做一件事,使用它

  • (void) webViewDidFinishLoad:(UIWebView *)webView){

    (void)webViewDidFinishLoad:(UIWebView *)webView){

    [webView.scrollView flashScrollIndicators];
    

    }

    }

can set indicator color as -

可以将指示颜色设置为 -

webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;

webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;