Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • changing the size of the frame with image

    • 0
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 220
    Comment on it

    To change the size of frame of the UIImageView as the image change can be done by getting the width and height of the UIImage. This can be done by declaring 2 float variables, storing the width and height of the image of the image in the respective variable and then use these variables in the frame of the UIImageView in which the UIImage is going to be placed.

    NSArray *myArray = [NSArray arrayWithObjects:@"image1.png",@"image2.png",@"image3.png", nil];
    float width;
    float height;
    
    UIImage *image = [UIImage imageNamed:[myImage.png]];
    width = myImage.size.width;
    height = myImage.size.height;
    
    UIImageView *imageView = [UIImageView alloc]initWithFrame:CGRectMake(50,50,width,height)];
    [imageView setImage :[UIImage imageNamed:[myImage.png]];
    [self.view addSubview:imageView];
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: