tags:

views:

31

answers:

0

When I try to run my app on the iPad the buttons are too big.

Below is two images One is of the app running on the iPHone sim. The other is the app running on the iPad sim. Notice the button in the iPad apps left hand corner. The button is too big. This is the code I use to create nav buttons.

Any help appreciated.

//add back bar button
    UIImage *imageBackBtn;
        UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
    imageBackBtn = [[UIImage imageNamed:@"ButtonBack.png"]  stretchableImageWithLeftCapWidth:10 topCapHeight:10];   
    [btnBack setBackgroundImage:imageBackBtn forState:UIControlStateNormal];  
    [btnBack addTarget:self action:@selector(cancel:)  
      forControlEvents:UIControlEventTouchUpInside];
    btnBack.adjustsImageWhenDisabled = NO;
    btnBack.adjustsImageWhenHighlighted = NO;


     btnBack.frame = CGRectMake(0, 0, 49, 30);        
    UIBarButtonItem *btnItemCancel = [[[UIBarButtonItem alloc]                                       initWithCustomView:btnBack] autorelease];  
    self.navigationItem.leftBarButtonItem = btnItemCancel; 

alt text alt text