0

I am rendering data from the service in the uiwebview, but i need to show the content in the webview from right to left, how to do that i have tried the following thing, but it doesnot apply to the content.

Here is my code.

[webView loadHTMLString:[NSString stringWithFormat:
                         @"<div align='right'>%@<div>",configdata] baseURL:nil];

If any code changes is there please help me. thank you in advance.

Daniyar
  • 2,975
  • 2
  • 26
  • 39
kool kims
  • 169
  • 2
  • 13
  • Check out this answer, may be help a bit- http://stackoverflow.com/questions/26252101/fit-image-of-random-size-into-a-uiwebview-ios/26252838#26252838 – Kampai Nov 12 '14 at 13:47

2 Answers2

3

I dot the solution for my answer, this is the code.

[webView loadHTMLString:[NSString stringWithFormat:@"<div dir='rtl'>%@<div>",configdata] baseURL:nil];

Here use dir = 'rtl', it resolved my question.

kool kims
  • 169
  • 2
  • 13
2

You have to style your div. By applying the text-align attribute. Give it a try. Just as advice, if you have a bunch of such div elements I recommend you to not use inline-style.

[webView loadHTMLString:[NSString stringWithFormat:@"<div style='text-align:right'>%@<div>",configdata] baseURL:nil];
Ramiz Wachtler
  • 5,623
  • 2
  • 28
  • 33