Reputation: 61
I'm trying to create an item description in a form of a list.
Example:
This description is sotred in my database, text as a data type.
The problem :
Im gettin all description in one line, I´ve tried to insert line breaks by replacing "." for "\n" and using HTML tags but doesnt seem to work.
htmlText = post.cloths_description;
String text = "<html><head>"
+ "<style>img{max-width:100%;height:auto;} figure{max-width:100%;height:auto;} iframe{width:100%;}</style> "
+ "<style type=\"text/css\">body{color: #000000;}"
+ "</style></head>"
+ "<body>"
+ htmlText
+ "</body></html>";
Result : 1. Medium 2. 100% Cotton 3. Etc
Any ideas on what else could I do ?
Best Regards
Upvotes: 0
Views: 219
Reputation: 742
Use line breaks.
<br />
Update: Try this:
Html.fromHtml(htmlText);
Upvotes: 1