Skip to content

Instantly share code, notes, and snippets.

@housemeow
Created August 25, 2014 04:59
Show Gist options
  • Select an option

  • Save housemeow/ae31c7a945c5d3b298c6 to your computer and use it in GitHub Desktop.

Select an option

Save housemeow/ae31c7a945c5d3b298c6 to your computer and use it in GitHub Desktop.
RelativeLayout contentView = (RelativeLayout) findViewById(R.id.advanceViewRelativeLayout);
Drawable drawable = MainActivity.view_image_drawable;// getResources().getDrawable(R.drawable.sample);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.BELOW, R.id.headerLine);
params.addRule(RelativeLayout.ABOVE, R.id.footerLine);
params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
params.setMargins(10, 10, 10, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment