UIWebView Size

Discussion in 'iOS Development' started by JoshuaCaputo, Dec 25, 2008.

  1. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    I want to have a UIWebView scale down to 32x48 but still scale the website...
    Possible?
  2. Spreche

    Spreche Member

    Joined:
    Dec 27, 2007
    Messages:
    164
    Likes Received:
    0
    Device:
    iPhone
    There is a property of UIWebView that you can use.

    Code:
    @property(nonatomic) BOOL scalesPageToFit
    
    If it is set to YES, the webpage is scaled to fit and the user can zoom in and zoom out. Otherwise if it is set to NO, the user zooming is disabled. The default value is NO.

    Or you might just be able to set the initWithFrame: method with specific demensions.

    Code:
     
    	UIWebView *myWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0.0, 0.0, 32.0, 48.0)];
    	myWebView.scalesPageToFit = YES;
    
    This may be wrong, but I think you'll get the jist.
  3. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    this is what i thought too but no
  4. Spreche

    Spreche Member

    Joined:
    Dec 27, 2007
    Messages:
    164
    Likes Received:
    0
    Device:
    iPhone
    Hmm I guess the webpage itself may have to be set to those specific demensions
  5. JoshuaCaputo

    JoshuaCaputo New Member

    Joined:
    Aug 2, 2008
    Messages:
    605
    Likes Received:
    0
    Device:
    iPod touch
    al-righty than
  6. godogshomie

    godogshomie New Member

    Joined:
    Nov 19, 2007
    Messages:
    558
    Likes Received:
    3
    do you have the class dumped UIKit cuz there is a method in there called setScale:float

    so try [webView setScale:32];

Share This Page