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

WKWebview Content not fitting properly on device orientation #21

Open
shkar62 opened this issue May 15, 2018 · 11 comments
Open

WKWebview Content not fitting properly on device orientation #21

shkar62 opened this issue May 15, 2018 · 11 comments

Comments

@shkar62
Copy link

shkar62 commented May 15, 2018

I have to load html content in wkwebview. I have added viewport and width=device-width,user-scalable=no. Initially the content loads properly in portrait mode, but when device is rotated to landscape and then back to portrait, the content overflows and does not fit to the device width. I dont need horizontal scrolling so I have disabled horizontal scroll of webview. Also I have reloaded web view on device orientation. Any help would be appreciated.

@Aby-117
Copy link

Aby-117 commented May 15, 2018

Try this line of code

Its supposed to make your webpage or app compatible with all devices.

@shkar62
Copy link
Author

shkar62 commented May 15, 2018

@Aby-117 cant see your code. Can you post again

@Aby-117
Copy link

Aby-117 commented May 15, 2018

I posted the code it somehow was not appearing
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
Now you'll be able to see it, its been a long time since I've done HTML and CSS but there are lots of bootstraps that can make your programmes compatible with other devices.
What are you making and what languages have you used to make it, if you wouldn't mind me asking?

@Aby-117
Copy link

Aby-117 commented May 15, 2018

Did it work?

@shkar62
Copy link
Author

shkar62 commented May 16, 2018

I am working on Visual Studio with C#. I have wkwebview in mobile application and have to load html content in it. How do I use bootstrap in mobile application?

@Aby-117
Copy link

Aby-117 commented May 16, 2018

Like this...
screenshot 25 _li

@shkar62
Copy link
Author

shkar62 commented May 17, 2018

not working

@Aby-117
Copy link

Aby-117 commented May 17, 2018

Maybe there is an error somewhere in your code... Just double check to make sure there nothing wrong with the lines of code you've written or check out the latest bootstrap links if that's not the case.

@shkar62
Copy link
Author

shkar62 commented May 18, 2018

Actually the html which I get from server is not responsive, as in it has fixed width. So on mobile device rotation, the width expands and when I rotate again to set in portrait mode, the html content overflows. So any suggestion for how to fix this?

@shkar62
Copy link
Author

shkar62 commented May 18, 2018

Also, I am developing iOS application so in that while rendering html in webview, I am facing problem.

@Aby-117
Copy link

Aby-117 commented May 18, 2018

I might recommend you to change fixed width into liquid width so that it can work for all devices and also in portrait mode. If the HTML code you've used is for fixed width than the code itself is self-explanatory, it says "fixed" which means it's going to stay the same use liquid width I think it might make a difference. I think webview has autofill framework codes as well but I don't really use webview so I don't know a lot about it.

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