博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iPhone控件之UIProgressView
阅读量:6850 次
发布时间:2019-06-26

本文共 1628 字,大约阅读时间需要 5 分钟。

1 //  2 //  UITestViewController.h  3 //  UITest  4 //  5  6 #import 
7 8 @interface UITestViewController : UIViewController
9 {
10 11 } 12 13 @end 14 15 16 17 // 18 // UITestViewController.m 19 // UITest 20 // 21 22 #import "UITestViewController.h" 23 24 UIImageView *largeImageView; 25 26 @implementation UITestViewController 27 28 - (void)viewDidLoad {
29 30 [super viewDidLoad]; 31 32 CGRect scrollFrame = CGRectMake(20,90,280,280); 33 UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollFrame]; 34 scrollView.minimumZoomScale = 0.5; 35 scrollView.maximumZoomScale = 2.0; 36 scrollView.delegate = self; 37 38 UIImage *bigImage = [UIImage imageNamed:@"appleLogo.jpg"]; 39 largeImageView = [[UIImageView alloc] initWithImage:bigImage]; 40 41 [scrollView addSubview:largeImageView]; 42 scrollView.contentSize = largeImageView.frame.size; //important! 43 44 [self.view addSubview:scrollView]; 45 46 [scrollView release]; 47 } 48 49 - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView 50 {
51 return largeImageView; 52 } 53 54 - (void)didReceiveMemoryWarning {
55 // Releases the view if it doesn't have a superview. 56 [super didReceiveMemoryWarning]; 57 58 // Release any cached data, images, etc that aren't in use. 59 } 60 61 - (void)viewDidUnload {
62 // Release any retained subviews of the main view. 63 // e.g. self.myOutlet = nil; 64 } 65 66 67 - (void)dealloc {
68 69 [largeImageView release]; 70 71 [super dealloc]; 72 } 73 74 @end

转载地址:http://frrul.baihongyu.com/

你可能感兴趣的文章
href=“javascript:”vs href=“javascript:void(0)”
查看>>
win10文件夹无法打开,双击闪屏
查看>>
【学习笔记14】全局类型转换器
查看>>
Spring Boot学习记录手册<1>
查看>>
在Word2007和Word2010中插入视频文件,并自动在word中播放
查看>>
javascript设置http请求的头信息
查看>>
C++调用java开启远程调试
查看>>
struts2与ajax交互
查看>>
Linux Shell脚本中点号和source命令
查看>>
Unix常用基本数据类型
查看>>
索尼竟用人工智能写了两首流行歌
查看>>
私有云portal
查看>>
Hadoop-环境搭建
查看>>
远程登录ssh免密码
查看>>
Linux下map hash_map和unordered_map效率比较
查看>>
Python学习笔记(二)网络编程的简单示例
查看>>
RabbitMQ 安装和配置
查看>>
Java8新特性之:Optional
查看>>
Redis简单介绍之(安装篇)
查看>>
网络协议控件,SSH 安全组件/n software Red Carpet Subscription
查看>>