Created
July 24, 2014 10:00
-
-
Save Reacoder/e11d2f3eaed2ae8654bf to your computer and use it in GitHub Desktop.
动态改变margin 布局。
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
private void moveUserInfoLayoutInY(int marginTop) { | |
MarginLayoutParams marginParams = new MarginLayoutParams(mUserInfoLayout.getLayoutParams()); | |
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, marginTop, getResources().getDisplayMetrics()); | |
marginParams.setMargins((int)mUserInfoLayout.getLeft(), (int)px, 0, 0); | |
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(marginParams); | |
mUserInfoLayout.setLayoutParams(layoutParams); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment