0

I set the Scroll view size to scroll up the content if they hide behind the Keypad. Its a universal app now I am doing same for iPad.

What would be the height/width of ipad screen and How do I set these for ipad?

code to check if its Ipad or Iphone

BOOL isiPhone = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone;
if (isiPhone)
           // write code

these are variable to set.

#define SCROLLVIEW_CONTENT_HEIGHT 460
#define SCROLLVIEW_CONTENT_WIDTH  320
Charles
  • 50,943
  • 13
  • 104
  • 142
Azhar
  • 20,500
  • 38
  • 146
  • 211

2 Answers2

1

iPad 768*1004 iPhone 320*480

I think it is better way to get height and width of iPad/iPhone

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    CGFloat height = [UIScreen mainScreen].bounds.size.height;
    NSLog(@"Width %f",width);
    NSLog(@"Height %f",height);
}
else if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    CGFloat height = [UIScreen mainScreen].bounds.size.height;
    NSLog(@"Width %f",width);
    NSLog(@"Height %f",height);
}
iDhaval
  • 7,824
  • 2
  • 21
  • 30
0

Look here how to manage the keyboard appearance.

http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html

A nicer way to do it is with scrollView.contentInset

Adrian Ancuta
  • 1,036
  • 9
  • 16