首页 > 代码库 > [翻译] 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.
项目中包含了如下的一些效果。
- View with Button 有Button的view
- ALAlertBannerStyleSuccess Success样式的view
- ALAlertBannerStyleFailure Failure样式的view
- ALAlertBannerStyleWarning Warning样式的view
- ALAlertBannerStyleNotify Notify样式的view
- Stacking Views 栈模式的view
[翻译] SlideInView
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。