HorizontalScrollView不使用管理列表内存的适配器,因此它无法处理繁重(图像,自定义视图等)列表。
您可以使用此水平ListView http://www.dev-smart.com/archives/34但确保您不写在getView中的列表项单击方法,它会使列表滚动缓慢。除此之外,这对于平滑的水平列表视图来说是一个很好的资源。
您也可以探索Android的看法寻呼机,这也支持使用兼容包下的Android版本:0
编辑 - 类似的东西在膨胀,你要(在LinearLayout中)的XML适配器和然后用相关数据填充每个视图。
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.chat_friends_list_item, null);
}
ImageView status = (ImageView)convertView.findViewById(R.id.status);
ImageView image = (ImageView)convertView.findViewById(R.id.image);
ImageView imageBorder = (ImageView)convertView.findViewById(R.id.image_border);
TextView title = (TextView)convertView.findViewById(R.id.title);
}