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 main.xml error in:

   & Lt; / LinearLayout & gt;    

Do not you have any logic?

You should add a constructor like this:

  public key activity (reference references, AttributeSet attrs) {super (references, attrs); }   

or

  public main activity (reference context) {super (reference); }   

You asked for a simple example of a custom view:

  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

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -