今天項目需要用到一個類似於安卓上的 Toast,
這個以前在網上看到過,但是一直沒用過,今天要用就特意上網搜索了一下,結果有很多,
我用的是 https://github.com/scalessec/Toast
右邊有個download就是下載,
下面 有介紹叫做readme.markdown
Setup Instructions
- Add
Toast+UIView.h
&Toast+UIView.m
to your project. - Link against QuartzCore.
- If you're using ARC, you'll need to add the
-fno-objc-arc
compiler flag toToast+UIView.m
.
Examples
// basic usage
[self.view makeToast:@"This is a piece of toast."];
// toast with duration, title, and position
[self.view makeToast:@"This is a piece of toast with a title."
duration:3.0
position:@"top"
title:@"Toast Title"];
// toast with an image
[self.view makeToast:@"This is a piece of toast with an image."
duration:3.0
position:[NSValue valueWithCGPoint:CGPointMake(110, 110)]
image:[UIImage imageNamed:@"toast.png"]];
// display toast with an activity spinner
[self.view makeToastActivity];
See the demo project for more examples.
這個或許更好點,可以搜索MBProgressHUD
日歷也也一樣,有PickerAlertView等很多第三方,可以到github搜索,也可以自己寫,uiswitch也可以自己寫