Skip to content

Instantly share code, notes, and snippets.

@kbshl
Created November 18, 2016 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbshl/f6a780ef2ff18042acaf1c93f9fa20c9 to your computer and use it in GitHub Desktop.
Save kbshl/f6a780ef2ff18042acaf1c93f9fa20c9 to your computer and use it in GitHub Desktop.
Set Layout Gravity Programmatically or rather align view at bottom of parent FrameLayout - Source: ((FrameLayout.LayoutParams) view.getLayoutParams()).gravity = Gravity.BOTTOM;
((FrameLayout.LayoutParams) view.getLayoutParams()).gravity = Gravity.BOTTOM;
// or on FrameLayout.LayoutParams creation
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(width != 0 ? width : FrameLayout.LayoutParams.MATCH_PARENT, height, Gravity.BOTTOM);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment