Thursday, 11 August 2011

View sliding-up from bottom on another View in iPhone/iPad

// For iPhone
// set custom view into frame

-(void)viewDidLoad
{
     [super viewDidLoad];
     newView.frame = CGRectMake(0,460,320, 290);
}

- (void)toggleThumbView {   
  
    CGRect frame = [newView frame];
    if (thumbViewShowing) {
       
       
        frame.origin.y += frame.size.height;       
    }
    else {
      
        frame.origin.y -= frame.size.height;
       
    }
   
    //slideUpView.hidden=YES;
   
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.51];
    //[slideUpView setFrame:frame];
   
    [viewName setFrame:frame];      //set here the view name what-ever you want sliding up.
   
    [UIView commitAnimations];
   
    thumbViewShowing = !thumbViewShowing;
   
   
}

Call above method "toggleThumbView " on Button Click

Wednesday, 10 August 2011

Use Image for UINavigationBar in iPhone/iPad

 In .m file before implement  use this code
 For example this is "RootViewController.m"
 
@implementation UINavigationBar (CustomImage)

- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed: @"imageName.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}

@end

@implementation RootViewController

Tuesday, 9 August 2011

Date Formate in iPhone/iPad

string that looks like this: ThursDay November 27, 2008
First store the Date String into NSString then

Monday, 8 August 2011

Use Custom Back Button in NavigationBar

 Use Following code in -(void)viewDidLoad {}

UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];


[btn setBackgroundImage:[UIImage imageNamed:@"btnImg.png"] forState:UIControlStateNormal];

 [btn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];

 btn.frame=CGRectMake(3, 2, 53, 30);

 UIBarButtonItem *btnBack=[[UIBarButtonItem alloc] initWithCustomView:btn];

 self.navigationItem.leftBarButtonItem=btnBack;

 [btnBack release];