Shape TierListView滚动问题

时间:2011-01-26 17:29:49

标签: android android-layout

我有一个使用形状xml文件作为背景的层视图。

Drawable greyGradient = 
    this.getResources().getDrawable(R.drawable.grey_gradient);
final TierListView tierView = (TierListView) findViewById(R.id.content_list);
tierView.setBackgroundDrawable(greyGradient);

我的问题是每当我滚动列表时,我在TierListView边缘的笔划就会消失。实际上整个xml文件停止工作,直到滚动停止。当我松开触摸时,笔划返回。如何保持笔划并使列表项在其中滚动?

<shape    
   xmlns:android="http://schemas.android.com/apk/res/android"    
   android:shape="rectangle" >    
<corners              
   android:topLeftRadius="5dip"        
   android:topRightRadius="5dip"        
   android:bottomLeftRadius="5dip"        
   android:bottomRightRadius="5dip" />   
<gradient        
   android:angle="90"              
   android:endColor="#000000"             
   android:startColor="#3d3d3d"       
   android:type="linear" />       
<size        
   android:scaleType="center" />      
<stroke        
   android:width="2dip"        
   android:color="#d6d7d6" />
</shape>

1 个答案:

答案 0 :(得分:0)

确定。所以我通过将android:layout_weight =“1”更改为5来解决问题。我不知道为什么这会产生影响(文档在layout_weight上是裸露的)但是确实如此。