Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在Fragment使用swipemenulistview #159

Open
xue12311 opened this issue Jun 20, 2017 · 0 comments
Open

在Fragment使用swipemenulistview #159

xue12311 opened this issue Jun 20, 2017 · 0 comments

Comments

@xue12311
Copy link

我现在在Fragment中使用swipemenulistview,左右滑动时,会触发ViewPager的滑动方法,这个应该怎么解决。

	viewPager.setOnPageChangeListener(new OnPageChangeListener() {
		// 当滑动状态改变时调用
		@Override
		public void onPageSelected(int arg0) {
			position=arg0;
		}

		// 当前页面被滑动时调用
		@Override
		public void onPageScrolled(int position, float positionOffset,
				int positionOffsetPixels) {

			LinearLayout.LayoutParams lp = (android.widget.LinearLayout.LayoutParams) id_tab_line
					.getLayoutParams();
			// 设置左边边界
			lp.leftMargin = (int) ((positionOffset + position)
					* screenWidth / 3);

			id_tab_line.setLayoutParams(lp);
		}

		// 当新的页面被选中时调用
		@Override
		public void onPageScrollStateChanged(int arg0) {

		}
	});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant