2015-02-23 47 views
1

我正在寻找任何库帮助我与视差效果控制器。IOS视差和PageControll

我需要顶部地图(我的第一个控制器)和底部的页面控件,带有视差效果的可滚动顶部以及左右标准效果。

不知道如何做呢?

这与谷歌地图应用(查找地点时)的效果相同。

+0

我不知道任何lib做到这一点。但是我发现了一些很棒的样本来达到这些效果。看看http://www.thinkandbuild.it/implementing-the-twitter-ios-app-ui/。我希望它能帮助你。 – KIDdAe 2015-02-23 08:53:10

回答

-1

嗨,如果你想视差效果对你的看法。你应该使用UIMotionEffects。这个API将为您提供设置好和易于管理视差效果的机会。请记住,视差图像应该比原始图像更大一些。

// Set vertical effect 
UIInterpolatingMotionEffect *verticalMotionEffect = 
    [[UIInterpolatingMotionEffect alloc] 
    initWithKeyPath:@"center.y" 
      type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; 
verticalMotionEffect.minimumRelativeValue = @(-10); 
verticalMotionEffect.maximumRelativeValue = @(10); 

// Set horizontal effect 
UIInterpolatingMotionEffect *horizontalMotionEffect = 
    [[UIInterpolatingMotionEffect alloc] 
    initWithKeyPath:@"center.x"  
      type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; 
horizontalMotionEffect.minimumRelativeValue = @(-10); 
horizontalMotionEffect.maximumRelativeValue = @(10); 

// Create group to combine both 
UIMotionEffectGroup *group = [UIMotionEffectGroup new]; 
group.motionEffects = @[horizontalMotionEffect, verticalMotionEffect]; 

// Add both effects to your view 
[myBackgroundView addMotionEffect:group]; 
+0

是的,但这不是我能做到的。 – Unmerciful 2015-02-23 09:28:09