我花了一天的時間嘗試更好地理解動畫。 下一個代碼很好,隱藏了我的tabbar。問題是它會延伸每個靠近它的UIButton。在標籤欄上包含一個自定義按鈕。如果它觸及另一層圖像,它會拉伸它。任何想法如何修復代碼以避免這種情況?由於動畫導致圖像拉伸
- (void)hideTabBar:(UITabBarController *) tabbarcontroller
{
[UIView animateWithDuration:0.3
delay:0.0f
options:UIViewAnimationCurveLinear
animations:^{
for(UIView *view in tabbarcontroller.view.subviews)
{
if([view isKindOfClass:[UITabBar class]] || [view isKindOfClass:[UIImageView class]])
{
[view setFrame:CGRectMake(view.frame.origin.x, 480, view.frame.size.width, view.frame.size.height)];
}
else
{
[view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y, view.frame.size.width, 480)];
}
}
}
completion:nil];
}
隱藏後:
您應該繼續並更詳細地描述您實際需要的內容 - 有時快速繪製的圖像確實令人感到奇怪。 – Till
新圖片已添加。回購將在幾秒鐘內添加。 – Segev
已添加與該程序的鏈接。 – Segev