是否有可能使iOS侧栏视图显示在主屏幕上而不是主屏幕移动到侧面?

时间:2013-05-30 06:54:00

标签: ios

目前,在iOS应用程序中,我看到有从条形图标签访问的侧视图或从左或右滑动,主视图向左或向右移动,“暴露”基础视图。当用户向左或向右滑动时,主视图是否可能停留在那里但是侧视图拖过主视图?

1 个答案:

答案 0 :(得分:0)

试试这个:

    - (IBAction)inputTileButton_TouchUpInside:(id)sender {


    if([inputTileButton isSelected]) {
        [Utility_Class AnimateViewToFrame:inputViewHiddenRect referenceView:rmHomeInputViewController.view];
        [inputTileButton setSelected:NO];
    }
    else {
        [Utility_Class AnimateViewToFrame:inputViewVisibleRect referenceView:rmHomeInputViewController.view];
        [inputTileButton setSelected:YES];
    }
}


+(void)AnimateViewToFrame:(CGRect)rect referenceView:(UIView *)view{

    if (!CGRectEqualToRect(view.frame,rect)) {
        [UIView animateWithDuration:kANIMATION_DURATION animations:^{
            [view setFrame:rect];

        } completion:^(BOOL completion){

        }];
    }

}