adding style dinamically to a TextView

by nou » Wed, 21 Apr 2010 06:54:27 GMT


Sponsored Links
 Hello

I have a String[] and I need to create a "paragraph" for each of the
strings in the array.

basically what I am doing at the moment is this:

      LinearLayout text = (LinearLayout)
this.findViewById(R.id.itemText);

      String[] ps = article.getATxt().split(Pattern.quote("\n"));

      for (String p : ps) {
         TextView newPar = new TextView(this);
         newPar.setPadding(0, 0, 0, 6);
         newPar.setText(p);
         text.addView(newPar);
      }

I am not happy with the way I format (padding) each new textView beign
created. I was wondering if there is a way to assign a style
dinamically so that I can extract from the code the styling.

Thanks

--



adding style dinamically to a TextView

by patbenatar » Wed, 21 Apr 2010 09:44:45 GMT


 This might help you:



Sponsored Links


Other Threads

1. Reset of the emulator?

On Vista, I deleted the userdata.img file, but after that I am not
able to launch the emulator at all.
Is there any other way to do a hard reset on Android emulator?





--~--~---------~--~----~------------~-------~--~----~

2. How does a user input a text on HVGA portrait mode with no keyboard, in the actual device.

I assume the question was more about actual devices when they ship
later this year. How will users input text on those devices? Will
there be a "virtual keyboard"? (so far I have not seen anything about
this in the SDK).

Peli





--~--~---------~--~----~------------~-------~--~----~

3. Android Colosseum Interview of webtide

4. RadioButton size

5. how to change Menu show up as VERTICAL?

6. Image not correctly viewed

7. Strange slow behavior in Emulator and how to recreate it (CameraPreview)