首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >具有大量优化视图的Horizontalscrollview?

具有大量优化视图的Horizontalscrollview?
EN

Stack Overflow用户
提问于 2012-09-24 02:20:09
回答 1查看 507关注 0票数 0

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

代码语言:javascript
复制
<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张图片,这可能会减慢应用程序的速度。我有几个问题:

每个滚动视图最多有3个新闻故事在屏幕上可见,水平滚动视图是否通过不提取绑定视图来优化这一点?

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

我把所有这些水平滚动视图放到一个垂直滚动视图中,但是我将一个水平滚动,垂直滚动视图也会滚动少量。

EN

回答 1

Stack Overflow用户

发布于 2012-09-24 06:19:18

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12558096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档