具有大量视图优化的水平滚动视图



我有一个看起来像脉冲的应用程序https://lh5.ggpht.com/JPrFfuPBYwxBKQYcqSxdmdBWsJPRfZAiYmnKboFBI3V8Zqq7GqTUG9R_sCui3KIL1g,它有大约8-10个新闻部分,每个部分大约有20-30个故事,我目前的设计是每个部分都是一个包含20-30个故事的水平滚动视图,这是我的suedomain.xml:

<LinearLayout>
<HorizontalScrollView>
<LinearLayout orientation:horizontal>
<RelativeLayout id:singlenewsstory>
<Imageview/>
<TextView/>
<RelativeLayout/>
<RelativeLayout id:singlenewsstory>
<Imageview/>
<TextView/>
<RelativeLayout/>
etc...
<LinearLAyout/>
<horizontalScrollView>
<HorizontalScrollView>
<LinearLayout orientation:horizontal>
<RelativeLayout id:singlenewsstory>
<Imageview/>
<TextView/>
<RelativeLayout/>
<RelativeLayout id:singlenewsstory>
<Imageview/>
<TextView/>
<RelativeLayout/>
etc...
<LinearLAyout/>
<horizontalScrollView>
<HorizontalScrollView>
<LinearLayout orientation:horizontal>
<RelativeLayout id:singlenewsstory>
<Imageview/>
<TextView/>
<RelativeLayout/>
<RelativeLayout id:singlenewsstory>
<Imageview/>
<TextView/>
<RelativeLayout/>
etc...
<LinearLAyout/>
<horizontalScrollView>
etc...

当然,我会动态填充我的布局,但我主要担心的是,使用这种设计,活动中会有大约200个视图和大约150个图像,这可能会减慢应用程序的速度。我有几个问题:

1-每个滚动视图在屏幕范围内最多有3个新闻故事可见,horizontalscrollview是否通过不绘制超出范围的视图来优化这一点。?

2-Horizontalscrollview是否适合我所做的事情,或者我还可以使用其他东西?

3-我把所有这些水平滚动视图放在一个垂直滚动视图中,但如果我水平滚动一个,垂直滚动视图也会滚动一小部分。

您能用列表视图替换滚动视图吗?列表视图只绘制屏幕上的内容,听起来就像是在滚动一组重复的视图。

最新更新