There are several constructors available for defining an ImageView.
For Example
1) public ImageView (Context context)
2) public ImageView (Context context, AttributeSet attrs)
3) public ImageView (Context context, AttributeSet attrs, int defStyle)**
I am confused in using 2nd and 3rd type of constructor.
basically i don’t know what to pass in place of AttributeSet.
Kindly provide a coding example.
Ways of creating imageView, ImageView with Context
Here when you want set the values like height, width gravity etc you need to set
based on the number of attributes you need to use no of setXXX() methods,.
2.Using Attribute set
you can define set of attributes like height, width etc in your res/values folder in separate xml file, pass the xml file to getXml()
Here you can also define your custom attributes in your xml . and you can access the by using the methods provided by AttributeSet class example
//Return the float value of attribute at ‘index’