UIImageView 是用来设置图片的显示方式
- (void)viewDidLoad { [super viewDidLoad]; // UIImageView *imangview=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"3.jpg"]]; imangview.frame=CGRectMake(20, 20, 50, 100); //imangview.image=[UIImage imageNamed:@"3.jpg"]; [self.view addSubview:imangview]; }
运行结果如下:
时间: 2024-10-16 21:24:52