UIWebView cropped for Arabic content on iOS 10.3

I ran into a problem with the latest version of iOS (10.3) regarding the Arab content of Arabic content uploaded to UIWebView. Text is trimmed on the left side, as shown in the screenshot.

text

The same thing happens with iBooks when I try to upload a file to it. This issue arose earlier on iOS 7, but was later fixed in iOS 8.

This question has already been discussed in this link: webview is cropped on ios7 but the answers are not applicable.

Any new suggestion that might help me?

UPDATE: Please note that this is the CSS used for the epub search call, and that how the edge is given, as well as manipulating the margins and the percent of width or width, does not solve the problem.

 html {
     height:840px;
     font-size:24px;
     width:100%;
 }

 body {
     margin:0px;
     padding:0px;
     width:100%;
 }

 #viewer {
     width:668px;
     height:840px;
 }

 #book {
     width:668px;
     height:840px;
     margin-left:50px;
     margin-right:50px;

     -webkit-column-count:auto;
     -webkit-column-width:668px;
     -webkit-column-gap:100px;
     text-align:justify;
 }

 .h {
     margin-top:8px;
 }
+4
1

, , iOS 10.3, 10.3.1, iOS 10.3, , , HTML , - RTL, , - - , - RTL .

HTML- Objective-C:

NSString *HTMLString = [NSString stringWithFormat:@"<body><div style='text-align: right; %@/></body>", yourHTMLString];
[webView loadHTMLString:HTMLString baseURL:nil];

Swift:

let HTMLString = "<body><div style='text-align: right; \(yourHTMLString)/></body>"
webview.loadHTMLString(HTMLString, baseURL: nil)

, - .

+3

Source: https://habr.com/ru/post/1674063/


All Articles