ScrollView中的WebView似乎工作正常,但警告不使用 - 替代?

Dav*_*ave 5 android android-webview android-scrollview

我读过的所有东西(在已经制作我的app :()后面写着"你永远不应该在ScrollView中使用WebView!".这是可以理解的,因为理论上你可以有两个滚动的东西,这将使奇怪的可用性.

但是 - 到目前为止,我没有看到任何不利影响.然后,我正在使用的每个WebView都不需要滚动 - 也许这使得它可以接受 - 即使它在技术上是错误的吗?

是否有不良影响,我只是没有注意到对特定版本的测试缺乏?

如果我不能在ScrollView中使用WebView,我将如何获得以下布局(我当前的应用程序):

LinearLayout
    ScrollView
        LinearLayout
            TextView //Title of article
            TextView //Subtitle of article
            RelativeLayout
                ImageView //Large Image (clickable to gallery)
                ImageView //"more photos icon"
            WebView // a small horizontal ad
            TextView // actual article text
            WebView //embedded HTML code ranging from iframe to video...etc
            WebView //embedded HTML code ranging from iframe to video...etc
            WebView // a small horizontal ad
            LinearLayout
                TextView //DB-driven "similar articles" list
            WebView //disqus comments
Run Code Online (Sandbox Code Playgroud)

注意:我意识到这是"错误的" - 但<center>在HTML 中使用标签也是如此,人们仍然总是有效地使用它们.差异似乎是有一个简单而又更好的替代方案<center>- 在Android中这种情况有类似的东西吗?获得上述内容的一种简单方法?

TN8*_*888 0

不要使用WebView。您可以附加到应用程序或使用 AdMob 的广告。视频就是VideoView。评论 webview 的替代方案是 make api(使用 php [POST] 和 sql)。使用 webview 不是必须的。我希望我有帮助