質問

1つの画像内にスクロールビューがあります。スクロールビューをズームインしてズームアウトしたいだけです。ピンチを実行するだけで、ズームインしてズームアウトするにはどうすればよいですか?

役に立ちましたか?

解決

ファイルを追加するだけです http://www.4shared.com/dir/-pgqzexr/zoominzoop.html あなたのプロジェクトに、これらの機能を通してそれを呼び出します。

ここ im2 uiviewです、そして私はそれの上に画像を貼り付け、それを渡します viewDidLoad このような、

- (void)viewDidLoad {
    [self loadFlowersInView:im2];
    [self.view addSubview:im2];
}

このようにこの関数を添付してください。

- (void) loadFlowersInView: (UIView *) backdrop
{
    NSString *create_button = nil;
    // Add the flowers to random points on the screen
    for (int i = 0; i < 1; i++)
    {
            MagPicAppDelegate *appdelegate = (MagPicAppDelegate *)[[UIApplication sharedApplication] delegate];

            NSString *whichFlower = appdelegate.imageName;
            UIImage *stemp = [UIImage imageNamed:@"approve.png"];
            DragView *dragger = [[DragView alloc] initWithImage:stemp];
            dragger.userInteractionEnabled = YES;
            dragger.center = CGPointMake(160.0f, 140.0f);
            [im2 addSubview:dragger];
            [dragger release];
        }
    }
    [self.view  addSubview:im2];
    [im2 release];
}

他のヒント

あなたは設定する必要があります maximumZoomScale および /または minimumZoomScale あなたのプロパティ UIScrollView 1.0以外の何かに、ユーザーがどれだけの量をズームイン/アウトできるかを定義する;)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top