iOS图像未出现 [英] IOS Image not appearing

查看:43
本文介绍了iOS图像未出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在iPhone上显示图像.目前,我有一张相当大的图片,大约为9000x4500.我正在尝试显示此图像在iPhone中的大小.我现在正在使用模拟器,但它不会显示.我在这里有一些非常简单的代码(使用phonegap):

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:

有人知道如何解决此问题吗?

Anyone know how to fix this issue?

推荐答案

弄清楚为什么它不起作用.似乎,如果尝试通过HTML在iOS上放置图像,则它可以处理的分辨率存在一定限制(看起来不是jpg,而是GIF和PNG可能与透明度有关).我要做的就是将照片缩小到原始大小的50%,并且可以正常工作.

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.

这篇关于iOS图像未出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆