draw view on top of an other

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

draw view on top of an other

Postby bela » Thu Aug 13, 2009 11:11 am

Hello,

I was wondering if it is possible to draw a textview object on the surface of a gridview. If it is, how can I do that?
This piece of source code doesn't seem to work:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public class MyCustomView extends GridView {
  3.  
  4.  
  5.  
  6. @Override
  7.  
  8.         protected void onDraw(Canvas canvas) {
  9.  
  10.                 super.onDraw(canvas);
  11.  
  12.                 TextView tv=new TextView(getContext());
  13.  
  14.                 tv.setText("abbababba");
  15.  
  16.                 tv.measure(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
  17.  
  18.                 tv.draw(canvas);
  19.  
  20.                
  21.  
  22.         }
  23.  
  24.  
  25.  
  26. }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


Please help!

Thanks,
bela
bela
Freshman
Freshman
 
Posts: 2
Joined: Mon Aug 10, 2009 4:17 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests