【发布时间】:2013-01-16 03:22:04
【问题描述】:
我读过的所有内容(在制作我的应用程序之后 :( )都说“你永远不应该在 ScrollView 中使用 WebView!”。这是可以理解的,因为理论上你可以有 2 个滚动的东西,这会产生奇怪的可用性.
但是 - 到目前为止,我没有看到任何不利影响。再说一次,我使用的每个 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
注意:我意识到这是“错误的”——但在 HTML 中使用 <center> 标签也是如此,人们仍然一直有效地使用它们。不同之处似乎在于<center> 有一个简单且更好的替代方案 - Android 中的这种情况是否有类似的东西?获得上述内容的某种简单方法?
【问题讨论】:
标签: android android-webview android-scrollview