zoukankan      html  css  js  c++  java
  • iPhone控件之UIProgressView

     1 //
    2 // UITestViewController.h
    3 // UITest
    4 //
    5
    6 #import <UIKit/UIKit.h>
    7
    8 @interface UITestViewController : UIViewController <UIScrollViewDelegate>
    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
  • 相关阅读:
    python解决线性规划问题
    python解决多变量最优化问题
    python处理单变量优化
    java枚举类常用方法
    java实现十大排序算法
    python解方程
    python科学计算包
    python做微积分
    php定界符<<<EOF讲解
    一键安装LNMP/LAMP
  • 原文地址:https://www.cnblogs.com/foxmin/p/2393632.html
Copyright © 2011-2022 走看看