Fonts of text are coming small on IPHone

Discussion in 'iPhone/iPad Programming' started by manoj.aggarwal, Aug 25, 2008.

  1. macrumors newbie

    Joined:
    Aug 25, 2008
    #1
    Hi,

    I have made a web mobileapplication using visual studio 2005. My site is working fine on Blackbery and on safari browser but when I open my application using iphone, fonts of text and size of controls are coming very small on iphone. I am not getting where is the problem. :( .

    I request everybody to help me out in this.
    link to my site is https://rsguru.etelmar.net/rsgmobile/

    You will see it works fine on browser when seen on computer but on iphone the fonts of text and size of controls are very small.

    A lot of thanks in advance.
     
  2. macrumors newbie

    Joined:
    Sep 4, 2008
    #2
    Same problem

    Hi

    I have the same problem :confused: and I want to know if you could fix it. Can you please let me know hao you corrected it?

    Thanks!!! :)
     
  3. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    This is by design and is under user control in MobileSafari. When the user rotates the phone the text becomes larger. When the user pinches/squeezes the web page the page zooms in and out. I can make your page so large that only a couple of lines of text appear on screen.

    This is the same for all web pages. Why do you think this is a problem?
     
  4. thread starter macrumors newbie

    Joined:
    Aug 25, 2008
    #4
    Hi,

    I just did two things to solve my problem.

    1. I added

    window.document.attachEvent("load",fnmove);
    var currentWidth = 0;
    function fnmove()
    {
    setTimeout(updateLayout, 10);
    }


    function updateLayout()
    {
    if (window.innerWidth != currentWidth)
    {
    currentWidth = window.innerWidth;
    var orient = currentWidth == 320 ? "profile" : "landscape";
    document.body.setAttribute("orient", orient);
    setTimeout(function()
    {
    window.scrollTo(0, 1);
    }, 100);
    }
    }


    setInterval(updateLayout, 400);


    script to my application .

    2. added <meta name="viewport" content="maximum-scale=1.0,initial-scale=1.0,minimum-scale=1.0"/> tag in my application .

    it is working fine now .

    A lot of thanks for your replies.
    I hope it will solve your problem.
     

Share This Page