java - How do I draw a EditText to canvas in android? -


i draw

edittext username = new edittext(context); 

to specific spot on canvas in

protected void ondraw(canvas canvas) {  } 

is possible draw on basis of x,y coordinate in java file without using xml layout?

yes can draw edittext on canvas, here hint:

edittext ed; . . . . .    ed.setdrawingcacheenabled(true); bitmap b = ed.getdrawingcache(); canvas.drawbitmap(bitmap, l, t, r, b, null); 

you can create/initialize edittext @ run time this:

edittext edittext = new edittext(this); edittext.settext("my text"); edittext.setwidth(180);          edittext.setbackgroundcolor(color.white); 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -