Created
February 16, 2017 13:42
-
-
Save CodeIdeal/0daf7c2f9bb0915e1cdaf5c5907ef7aa to your computer and use it in GitHub Desktop.
通过代码给CoordinatorLayout中的子view设置Behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
@ViewInject(R.id.page_two) | |
private NestedScrollView pageTwo; | |
... | |
... | |
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) pageTwo.getLayoutParams(); | |
layoutParams.setBehavior(new PageBehavior(mAct, new PageBehavior.OnSwitchListener() { | |
@Override | |
public void onSwitch(int page) { | |
Log.d("kaka", "onSwitch: "+page); | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment