UIImangeView

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

UIImangeView的相关文章

从零开始学习ios(UIImageView)控件及其属性

//创建图片视图时就设定Frame的属性和大小 UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(60, 20, 80, 100)]; [img setImage:[UIImage imageNamed:@"mtxx6"]]; /* 创建图片视图的另外四种方法 type img{ UIImageView *img1 = [[UIImageView alloc]init]; UIImageView *img2