Aiming to achieve a unique layout using dynamic html strings.
The challenge arises when transitioning to the second page as the layout does not adjust upward and images cannot be added to the first page.
Attempting to implement the following sample code in native code:
func setData(){
let dic = arrayData[currentIndex]
url = dic["ImageLink"] as! String
self.url = self.url + "_MEDVPF.gif"
content = dic["ArticleXML"] as! String
let height = String(describing:webViewObj.frame.size.height - 100) + "px"
let width = String(describing: self.view.frame.size.width / 3 - 20) + "px"
// let style = "<div style=color:#0000FF>" + String(describing: dic["HeadLine"]!) + "<br /><br />" + String(describing: dic["Abstract"]!) + "</div>"
self.headlineLabel.text = dic["HeadLine"] as? String
self.abstractLabel.text = dic["Abstract"] as? String
var styleCSS = "font-family: TAUN_Elango_Abirami; font-size: 18px; column-width: %@; column-gap: 10px; height:%@;>"
styleCSS = String(format:styleCSS,width,height)
let bodyStyle = "<div style= \"%@\"" + content + "</div>"
let bodyStyleConten = String(format:bodyStyle,styleCSS)
let htmlString = String(format:bodyStyleContent)
let finalDiv = "<div>" + htmlString + "</div>"
webViewObj.loadHTMLString(finalDiv, baseURL: nil)
}
https://i.stack.imgur.com/45nU8.jpg
How can I create an Html5 with CSS design that enables horizontal scrolling?
While we initially experimented with using core text in iOS, performance issues prompted us to switch to uiwebview.
Although we managed to work with the CoreText framework, challenges persisted due to sluggishness when handling extensive content. Despite numerous attempts, we were unable to rectify the slowness issue. Assistance in overcoming this obstacle would be greatly appreciated, and we are open to sharing samples for those interested in contributing.