Created
June 7, 2018 07:56
-
-
Save valentincognito/0ef8e14d7b41acd0197343b48fc774bb to your computer and use it in GitHub Desktop.
Create and add a new imageView in a relativeLayout with parameters
This file contains 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
RelativeLayout rl = findViewById(R.id.spenViewLayout); | |
ImageView duplicate = new ImageView(getApplicationContext()); | |
duplicate.setImageDrawable(getDrawable(R.drawable.love)); | |
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(300, 300); | |
params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE); | |
rl.addView(duplicate, params); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment