Created
April 10, 2012 21:37
-
-
Save swarut/2354762 to your computer and use it in GitHub Desktop.
Android : Custom view from ViewGroup
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
public class MyCustomView extends LinearLayout{ | |
public MyCustomView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
View.inflate(context, R.layout.your_layout_name, this); | |
} | |
public MyCustomView(Context context, AttributeSet attrs) { | |
this(context, null, 0); | |
} | |
public MyCustomView(Context context) { | |
this(context, null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment