Android的曲线列表视图 [英] Android Curved Listview

查看:198
本文介绍了Android的曲线列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实施的android列表视图将看起来完全像这样和滚动

i am implementing a listview in android which will look exactly like this and scroll

我一直在做这通过设置充气行布局PARAMS在我的适配器的getView但边棱,由于这个问题是,列表视图变得生涩。也就是说,它仅更新,当一个行已完全从筛子和getView被称为提供了新的PARAMS到导致抽搐所有可见的行动画可以被应用,并且可以ListView的滚动位置是preciesly采取了行。 我想是的观点,即之间的平滑过渡为列表视图向上移动哪怕是一点点的内部意见应pcisely规模$ P $与运动。

I have been doing this by setting the layout params of inflated rows in getView of my adapter but the issue which arrises due to this is that the list-view becomes jerky. i.e. it only updates the rows when one row has completely passed from screen and getView has been called giving new params to all visible rows resulting in jerks can animation be applied and can listview scroll position be preciesly taken. what i want is a smooth transition between views i.e. as the listview moves up even a little bit the inner views should scale precisely with that movement.

推荐答案

这是我第一次一级的执行来解决这个问题,希望它可以帮助有兴趣的人,在arrHeight和arrWidth是动态创建的活动开始使用贝塞尔路径算法

This was my first level implementation to solve this problem hope it helps anyone interested, The arrHeight and arrWidth are created dynamically on activity start using Bezier Path Algorithm

public class TimelinePinsAdapter extends ParentLazyAdapter {

    LinearLayout ll_PinsContainer;
    LinearLayout.LayoutParams llParams_PinParameters;

    public TimelinePinsAdapter(Activity a, ArrayList<HashMap<String, String>> d) {
        super(a, d);
    }

    public int getCount() {
        return data.size();
    }

    public Object getItem(int position) {
        return position;
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        vi = convertView;
        if (convertView == null)
            vi = inflater.inflate(R.layout.rowsinflate, null, false);
        ll_PinsContainer = (LinearLayout) vi.findViewById(R.id.item);
        llParams_PinParameters =
            new LinearLayout.LayoutParams(0,
                (int) TimeLineActivity.arrHeight[position % 7]);
        ll_PinsContainer.setLayoutParams(llParams_PinParameters);

        return vi;
    }
}

这篇关于Android的曲线列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆