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
[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 - A few questions about styles

A few questions about styles

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

A few questions about styles

Postby BGH » Tue Apr 14, 2009 3:03 am

I have a table layout that I add rows to dynamically. The rows contain textviews. I am trying to create styles to apply to the textviews that are inserted into the table rows but I'm experience a few quirks.

From what I can gather I should be able to create a new textview that uses a style by using

Textview tv = new TextView(this, null, R.style.score_team);

But this doesn't seem to work. It creates the textview but the style isn't applied to it. I have to manually set the style by using

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Textview tv = new TextView(this);
  2.  
  3. tv.setTextAppearance(this, R.style.score_team);
  4.  
  5.  
Parsed in 0.011 seconds, using GeSHi 1.0.8.4

Also

I can't get the style to apply gravity. If I put
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <item name="android:gravity">center</item>
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


it doesn't apply the gravity (all the other attributes of the style are applied). I have to set the gravity manually by doing the following.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Textview tv = new TextView(this);
  2.  
  3. tv.setTextAppearance(this, R.style.score_team);
  4.  
  5. tv.setGravity(Gravity.CENTER);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


Which works.

Any clues as to either problem?
User avatar
BGH
Junior Developer
Junior Developer
 
Posts: 23
Joined: Thu Feb 12, 2009 3:51 am
Location: Melbourne, Australia

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests