Created
February 20, 2015 12:36
-
-
Save igordeoliveirasa/74a4a9e0974981de52a5 to your computer and use it in GitHub Desktop.
Linear Layout Programmatically
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
LinearLayout linearLayout = new LinearLayout(context); | |
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT); | |
layoutParams.setMargins(context.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin),0,0,0); | |
linearLayout.setLayoutParams(layoutParams); | |
linearLayout.setBackground(context.getResources().getDrawable(R.drawable.shape_rounded_background)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment