我创建了一个 UIView。 我需要在特定位置设置一个小图像。
我可以在一个单独的小 View 中设置图像。 但是,我计划在全屏的大型 UIView 上动态地执行此操作。 谢谢。
最佳答案
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,200)];
view.backgroundColor=[UIColor clearColor];
[self.view addSubview:view];
// add image in view
UIImageView *imageView =[[UIImageView alloc] initWithFrame:CGRectMake(50,50,20,20)];
imageView.image=[UIImage imageNamed:@"image.png"];
[view addSubview:imageView];
关于ios - 如何在特定位置的 uiimage View 上设置小图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34824100/