如何在iOS中实现浮动操作按钮?

时间:2016-08-08 05:43:01

标签: ios xamarin

请告诉我如何在iOS中实现浮动操作按钮(FAB)。我已经看到这个链接jamesmontemagno / FloatingActionButton-for-Xamarin.Android并且能够在Android中完成。请告诉我在iOS中实现它的代码。 环境:Xamarin.Forms。

3 个答案:

答案 0 :(得分:2)

在Xamarin商店中有一个类似的免费组件,用于Xamarin.iOS和一个用于Xamarin.Forms的Nuget库

Liquid Floating Action Button for Xamarin.iOS

Floating Action Button For Xamarin.Forms

答案 1 :(得分:0)

在IOS中实施浮动操作按钮的结帐链接。
github Library

答案 2 :(得分:-2)

使用VCFloatingActionButton可可。 为了获得更好的动画,按钮隐藏菜单,请使用下面的代码。

-(void) dismissMenu:(id) sender

{
    [UIView animateWithDuration:animationTime / 2 animations:^{
        self.pressedImageView.alpha = 0.0f;
        self.pressedImageView.transform = CGAffineTransformMakeRotation(M_PI/2);
        self.normalImageView.transform = CGAffineTransformMakeRotation(0);
        self.normalImageView.alpha = 1.0f;

        [UIView animateWithDuration:0.3f animations:^{

            [self.bgView setAlpha:1.0f];
            NSMutableArray* arrayIndexpath = [[NSMutableArray alloc] init];
            while (noOfRows > 0) {
                noOfRows -= 1;
                NSIndexPath* indexPath = [NSIndexPath indexPathForRow:noOfRows inSection:0];
                [arrayIndexpath addObject:indexPath];
            }
            [_menuTable deleteRowsAtIndexPaths:arrayIndexpath withRowAnimation:UITableViewRowAnimationFade];
            [_menuTable reloadData];

        }
            completion:^(BOOL finished) {

                [UIView animateWithDuration:0.3f animations:^{

                    [self.bgView setAlpha:0.0f];

                }
                                 completion:nil];

            }];

    }
        completion:^(BOOL finished){

        }];
}