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
I can't get the style to apply gravity. If I put
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.
Any clues as to either problem?