IOS Image not appearing

試著忘記壹切 提交于 2021-02-09 11:44:08

问题


I'm having trouble with showing an image on an iPhone. Currently, I have a pretty large image, around 9000x4500. I'm trying to show this image resized in an iPhone. I'm working with the simulator now and it just will not show up. I have some pretty simple code here (using phonegap):

<!DOCTYPE HTML>
<html>
  <head>

    <script charset="utf-8" src = "jquery-1.10.1.min.js"></script>
    <script charset="utf-8" src = "cordova.js"></script>
    <style>
        img.Image {
            width: 100%;
            max-width:100%;}


    </style>            

   </head>
   <body>

     <img src = "FloorPlans/plazaone.png" class = "Image" />

   </body>

</html> 

And here's a screenshot of what my simulator looks like: http://i.imgur.com/3YyFS8E.png

Anyone know how to fix this issue?


回答1:


Figured out why it wasn't working. It seems that if one tries to put an image on iOS through HTML, there is a certain limit of what resolution it can handle (not for jpgs it seems, but for GIFs and PNGs, might have something to do with transparency). All I had to do was resize my pictures down to 50% of their original size and they worked.



来源:https://stackoverflow.com/questions/17838212/ios-image-not-appearing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!