Reading XML-Attributes in the XML-Constuctor of Views
What you will learn: You will learn how to read out Atributes like [font=Courier New]layout_height[/font] in the XML-Constructor of your custom View.
Difficulty: 1 of 5

Using java Syntax Highlighting
- public MySuperDuperView(Context ctx, AttributeSet attrs, final int cellsEach) {
- super(ctx, attrs);
- TypedArray a = ctx.obtainStyledAttributes(attrs, android.R.styleable.ViewGroup_Layout);
- this.WIDTH = (int)a.getDimension(android.R.styleable.ViewGroup_Layout_layout_width, MyConstants.NOT_SET);
- this.HEIGHT = (int)a.getDimension(android.R.styleable.ViewGroup_Layout_layout_height, Constants.NOT_SET);
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Thats it 

Regards,
plusminus



