Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HtmlViewer and HtmlBlock #54

Open
kinju4374 opened this issue Oct 10, 2016 · 3 comments
Open

HtmlViewer and HtmlBlock #54

kinju4374 opened this issue Oct 10, 2016 · 3 comments

Comments

@kinju4374
Copy link

I am trying to display HTML which I received from my server in HtmlBlock, it displays properly but the style applied are not there in displayed Html. Do we need to manually add them on the mobile side within this control?

Even I tried to use HtmlViewer but it is not displaying content.

Can you suggest what is the issue?

Code

HtmlViewer webView = new HtmlViewer() {IsHitTestVisible=true };
string htmlContent;
if (hexcolor != null)
{
htmlContent = string.Format("{0}" +
"<body style="margin:0px;padding:0px;background-color:{2};">{1}",
notifyJS,
formItem.I_DEFAULT_VALUE,
hexcolor);
}
else
{

                    htmlContent = string.Format("<html><head>{0}</head>" +
                                                    "<body onLoad=\"setupBrowser()\" style=\"margin:0px;padding:0px;background-color:{2};\">" +
                                                    "<div id=\"pageWrapper\" style=\"width:100%;word-wrap:break-word;\">{1}</div></body></html>",
                                                    notifyJS,
                                                    formItem.I_DEFAULT_VALUE,
                                                    MCSManager.Instance.currentClientParams.BACKGROUND_COLOUR.VALUE);

                }


                webView.Html =htmlContent;`
@kinju4374
Copy link
Author

Any Update on this ?

@javitosanchez
Copy link
Collaborator

HtmlViewer & HtmlBlock apply its own styles. For your scenario it's better to use the WebView control

@kinju4374
Copy link
Author

kinju4374 commented Oct 14, 2016

OK. I tried to use WebView but it is sometimes give different height when I am trying to find height dynamically based on HTML Content using document.body.firstChild.offsetHeight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants