Package COM. puppet. custom. component; import android. content. context; import android. graphics. canvas; import android. graphics. color; import android. graphics. paint; import android. widget. edittext; public class searchedittext extends edittext {private paint; Public searchedittext (context) {super (context); // defines paint = getpaint (); // define the stroke width style paint. setstyle (paint. style. stroke); // define the stroke color paint. setcolor (color. gray);} @ override protected void ondraw (canvas) {super. ondraw (canvas); int W = getwidth (); int H = getheight (); // canvas of the lower border. drawline (0, H, W, H, paint); // canvas on the right border. drawline (W, 0, W, H, paint); // canvas with the left border. drawline (0, 0, 0, H, paint); // top border canvas. drawline (0, 0, W, 0, paint );}}
Tip: http://android123.blog.51cto.com/2099282/517533