SwipeView类似桌面的滑动界面(6)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-06 08:44 点击:次
page--;
}
else if(page<0)
{
page=0;
}
if(smooth)
{
smoothScrollTo(page*mPageWidth,0);
}
else
{
scrollTo(page*mPageWidth,0);
}
mCurrentPage = page;
if(mOnPageChangedListener!=null && oldPage!=page)
{
mOnPageChangedListener.onPageChanged(oldPage, page);
}
if(mPageControl!=null && oldPage!=page)
{
mPageControl.setCurrentPage(page);
}
mCallScrollToPageInOnLayout=!mCallScrollToPageInOnLayout;
}
/**
* Set the width of each page. This function returns an integer that should be added to the left margin of
* the first child and the right margin of the last child. This enables all the children to appear to be
* central
*
* @param pageWidth The width you wish to assign for each page
* @return An integer to add to the left margin of the first child and the right margin of the last child
*/
public int setPageWidth(int pageWidth)
{
mPageWidth = pageWidth;
return (SCREEN_WIDTH - mPageWidth)/2;
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>