Today saw a memory management software, the interface is all in the program to draw out, understand only to find that the original memory management software because the interface is constantly changing
So only in the program through the code to achieve, this will be designed to the view class in Android, directly on the code:
Import Android.os.Bundle;
Import android.app.Activity;
Import Android.content.Context;
Import Android.graphics.Canvas;
Import Android.graphics.Color;
Import Android.graphics.Paint;
Import Android.view.Menu;
Import Android.view.View;
public class Mainactivity extends Activity {
@Override
protected void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (New MyView (this));
}
Private class MyView extends view{
Public MyView (Context context) {
Super (context);
TODO auto-generated Constructor stub
}
/* (Non-javadoc)
* @see Android.view.view#ondraw (Android.graphics.Canvas)
*/
@Override
protected void OnDraw (canvas canvas) {
TODO auto-generated Method Stub
Super.ondraw (canvas);
Paint Paint =new paint ();
Paint.setantialias (FALSE);
Paint.setcolor (Color.Blue);
Canvas.drawcircle (A.);
}
}
}
This is a simple drawing that draws a circle on the screen and shows the activity through Setcontentview (new MyView (This))
1. First of all we need to understand a few of these concepts, paint brush, canvas canvas, that is, this screen is the equivalent of a canvas canvases, you hold the paint
Draw what you want from the top.
2.paint There are many parameters, where Paint.setantialias (false), this is set whether the brush anti-aliasing, directly on, you can see the difference or
650) this.width=650; "title=" is not anti-aliasing. JPG "style=" Float:none; "src=" Http://s3.51cto.com/wyfs02/M00/54/13/wKiom1R3E3Tx1EorAABn1QHKeXw474.jpg "alt=" Wkiom1r3e3tx1eoraabn1qhkexw474.jpg "/>
650) this.width=650; "title=" anti-aliasing. JPG "style=" Float:none; "src=" Http://s3.51cto.com/wyfs02/M01/54/11/wKioL1R3E_fhkL7DAACB7wLx4SE447.jpg "alt=" Wkiol1r3e_fhkl7daacb7wlx4se447.jpg "/>
Very large, so we generally want to set this to Ture
3.canvas has a lot of graphics that can be called directly
Let's go ahead and write about it here today!!!!!!!!
Rushing to Daniel's Android: How the Learning interface is drawn in the program