iOS应用开发中图片的拉伸问题解决方案

2020-01-14 19:31:55王振洲

frame.size.width += 100;  
strechTest.frame = frame;  
 

//把imageView放入button中,并设置为back  
 UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];  
 button1.frame = frame;  
 button1.center = CGPointMake(160, 140);  
 [button1 addSubview:strechTest];  
 [button1 sendSubviewToBack:strechTest];  
 [button1 setBackgroundColor:[UIColor clearColor]];  
 [button1 setTitle:@"button" forState:UIControlStateNormal];  
 [button1 setTitle:@"buttonClick" forState:UIControlStateHighlighted];  
 [self.view addSubview:button];  


 

效果:

iOS应用开发中图片的拉伸问题解决方案



注:相关教程知识阅读请移步到IOS开发频道。