Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - How to get String width

How to get String width

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

How to get String width

Postby c3r13e12u5 » Wed Oct 29, 2008 3:28 am

How can i get how many pixels will be used to draw a String on the canvas?
in J2ME we can use Font.stringWidth(String s). how about in Android?
c3r13e12u5
Developer
Developer
 
Posts: 28
Joined: Wed Oct 08, 2008 7:33 am

Top

Postby c3r13e12u5 » Tue Nov 04, 2008 2:07 am

Finally got the code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Paint p = new Paint();
  2.  
  3. p.measureText("Test Measure Text");
Parsed in 0.012 seconds, using GeSHi 1.0.8.4
c3r13e12u5
Developer
Developer
 
Posts: 28
Joined: Wed Oct 08, 2008 7:33 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests