Skip to content

Commit

Permalink
fix: image viewer on different device orientations (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba authored Nov 27, 2024
1 parent 77c4155 commit 8d66833
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Sources/Screens/Viewer/Image/ViewerImageWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,31 @@ struct ViewerImageWebView: UIViewRepresentable {
webView.loadHTMLString(
"""
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
background: #000;
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
width: 100%;
height: 100%;
overflow: scroll;
}
img {
width: 100%;
height: auto;
object-fit: contain;
max-width: 100%;
max-height: 100%;
}
</style>
</head>
<body>
<img src="\(url.absoluteString)" alt="Image">
<img src="\(url.absoluteString)" />
</body>
</html>
""",
Expand Down

0 comments on commit 8d66833

Please sign in to comment.