Saturday, October 5, 2013

Changing UIView picture size, so that it can be accommodated UIView

iPhone development

UIView * images = [[UIView alloc] init];

images.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "strong spring beauty book - directory. png"]];

images.frame = CGRectMake (0,0,768,1024);

[Self.view addSubview: images];

After running discovery Picture "strong spring beauty book - directory. Png" display is not complete, only a part, ask the experts how to solve?
Reply:
iPhone development

Wrong setting big images.frame = CGRectMake (0,0,768,1024);

Instead images.frame = CGRectMake (0,0,320,480);

Reply:
Wrong, the iPad development
Ask the experts how to solve
Reply:
Add directly to uiview uiimageview uiimageview inside the image is the picture, and then set the size for uiview uiimageview size
Reply:
imageView.contentMode = UIViewContentModeScaleAspectFit;

No comments:

Post a Comment