[翻译] SlideInView

本文介绍了一种轻量级的SlideInView实现方案,能够轻松地在屏幕底部弹出通知视图。该方案不仅适用于各类消息提示,还支持多种样式如成功、失败等,并提供了示例代码。

SlideInView

This is a quick and lightweight example of how to present a notification like view from the bottom of a view. Using SlideInView, the code you'd need would look something like this:

这是一个快速、轻量级的示例工程,用来展示一个通知信息,从这个view的底部。如果要使用SlideInView,你只需要写下面几行代码就行了:

UIView *notificationView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 100)];
notificationView.backgroundColor = [UIColor colorWithRed:5/255.0 green:61/255.0 blue:98/255.0 alpha:1];

SlidingViewManager *svm = [[SlidingViewManager alloc] initWithInnerView:notificationView containerView:self.view];

[svm slideViewIn];

The different approach taken here is to animate any view, without making assumption about whether it is a Warning or Failure message like many other libraries do.

不同的地方在于,这个可以用于任何view的动画,而不仅仅区分于警告信息、失败信息等等固定的view。

Included are simple demos, most of which emulate the style you'd see in ALAlertBanner.

这里包含了一个示例的demo,你可以看到所有他能做到的事情。

Currently all included in the same video.

项目中包含了如下的一些效果。

  1. View with Button 有Button的view
  2. ALAlertBannerStyleSuccess Success样式的view
  3. ALAlertBannerStyleFailure Failure样式的view
  4. ALAlertBannerStyleWarning Warning样式的view
  5. ALAlertBannerStyleNotify Notify样式的view
  6. Stacking Views 栈模式的view

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值