Android05_下拉滚动事件OnScrollListener

来源:互联网 发布:淘宝达人后台v任务报名 编辑:程序博客网 时间:2024/06/07 05:14

1.OnScrollListener 下拉滚动的那个操作的继承代码:(摘抄,可以研究)

public interface OnScrollListener {

//滚动下拉的接口

        /**

         * The view is not scrolling. Note navigating the list using the trackball counts as

         * being in the idle state since these transitions are not animated.

         */

        public static int SCROLL_STATE_IDLE = 0;

        /**

         * The user is scrolling using touch, and their finger is still on the screen

         */

        public static int SCROLL_STATE_TOUCH_SCROLL = 1;

        /**

         * The user had previously been scrolling using touch and had performed a fling. The

         * animation is now coasting to a stop

         */

        public static int SCROLL_STATE_FLING = 2;

        /**

         * Callback method to be invoked while the list view or grid view is being scrolled. If the

         * view is being scrolled, this method will be called before the next frame of the scroll is

         * rendered. In particular, it will be called before any calls to

         * {@link Adapter#getView(int, View, ViewGroup)}.

         *

         * @param view The view whose scroll state is being reported

         *

         * @param scrollState The current scroll state. One of {@link #SCROLL_STATE_IDLE},

         * {@link #SCROLL_STATE_TOUCH_SCROLL} or {@link #SCROLL_STATE_IDLE}.

         */

        public void onScrollStateChanged(AbsListView view, int scrollState);

        /**

         * Callback method to be invoked when the list or grid has been scrolled. This will be

         * called after the scroll has completed

         * @param view The view whose scroll state is being reported

         * @param firstVisibleItem the index of the first visible cell (ignore if

         *        visibleItemCount == 0)

         * @param visibleItemCount the number of visible cells

         * @param totalItemCount the number of items in the list adaptor

         */

        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,

                int totalItemCount);

    }

    /**

     * The top-level view of a list item can implement this interface to allow

     * itself to modify the bounds of the selection shown for that item.

     */

2.今天学习学到了一个很重要的东西,就是相信自己,一定要相信自己,不能看高别人——“在战略上要藐视对手,在战术上要正视对手”;因为今天我自己又独立地解决了bug,因为我自己知道这个bug我是不可能解决的,所以我一直不敢相信自己能够做好,所以我就不想自己独立地解决,但是同时也有个问题,就是我不敢、不好意思问老师。,我感觉我的问题太简单了,所以不能问老师,问了老师老师就会很生气地说我问题太多,事实上也是的哦。我上课没有认真,所以就不能做好,以后上课得自己先理解,不理解永远不会懂得。

3.今天学的,那个实线分界线,以及颜色的设置是这样地代码:—— android:divider="#FF0000"颜色,        android:dividerHeight="2dp"实线的厚度

4.weight是占的比重:如果这俩个在一个横框里:则android:layout_weight="1",(占了四分之一);android:layout_weight="3"(占了四分之三)。

等等

0 0
原创粉丝点击