android - Creating a Custom View and XML Namespace -
I am trying to create custom views in Android, I have mentioned all my attendants list in main activity and XML file But I have a Do not you have any logic? You should add a constructor like this: or You asked for a simple example of a custom view: } main.xml error in:
public key activity (reference references, AttributeSet attrs) {super (references, attrs); }
public main activity (reference context) {super (reference); }
Public Square Birdwave Extended ImageView {Personal Float Direction = 0; Paint paint = new paint (); Public Birdview (Reference Reference) {Super (Reference); } Public bird view (reference references, AttributeSet attrs) {super (references, attrs); Paint.setColor (Color.WHITE); Paint.setStrokeWidth (6); } Public Birdview (Reference Reference, AttributeSet attrs, int defStyle) {super (references, attrs, defStyle); } @ Override Protected Zero Measurement (int width mowersPEC, int heightmeasureSpec) {Settamed dimension (measurementspace gatesis (width mouseover), Mijerspsiceptisis (heightMARSAPC)); } @ Override Public Empty Draw (Canvas Canvas) {canvas.save (); Int stratX = getWidth () / 2; Int startY = getHeight () / 2; Canvas Rotate (direction, straight x, start); Super.draw (canvas); Canvas.restore (); Canvas.drawLine (Stretch X, Start, Stratax, Startup + 80, Paint); } Public Zero Update (Float DIR) {direction = dir; Invalid (); }
Comments
Post a Comment