-(void) viewDidAppear:(BOOL)animated { //*** Example*** //UIButton *pauseImg; //pauseImg =[self drawImage:pauseIcon inImage:pauseImg]; } -(UIImage*) drawImage:(UIImage*) fgImage inImage:(UIImage*) bgImage { UIGraphicsBeginImageContextWithOptions(bgImage.size, FALSE, 0.0); [bgImage drawInRect:CGRectMake( 0, 0, bgImage.size.width, bgImage.size.height)]; [fgImage drawInRect:CGRectMake( 0, 0, fgImage.size.width, fgImage.size.height)]; UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return newImage; }
iOS UIbutton overlay
iOS Screen size based on orientation
//Get current screen size based on the orientation of the device -(CGSize) currentSize { return [self sizeInOrientation:[UIApplication sharedApplication].statusBarOrientation]; } -(CGSize) sizeInOrientation:(UIInterfaceOrientation)orientation { CGFloat scale = [[UIScreen mainScreen] scale]; CGSize size = [UIScreen mainScreen].bounds.size; if (UIInterfaceOrientationIsLandscape(orientation)) { size = CGSizeMake(size.height*scale, size.width * scale); } return size; } -(void) viewDidAppear:(BOOL)animated { CGSize size = [self currentSize]; NSLog(@"%f",size.height); NSLog(@"%f",size.width); }
Subscribe to:
Posts (Atom)