IOS上的Toast


 

今天項目需要用到一個類似於安卓上的 Toast,

 這個以前在網上看到過,但是一直沒用過,今天要用就特意上網搜索了一下,結果有很多,

 

我用的是 https://github.com/scalessec/Toast

 

 

右邊有個download就是下載,

下面 有介紹叫做readme.markdown



Setup Instructions

  1. Add Toast+UIView.h & Toast+UIView.m to your project.
  2. Link against QuartzCore.
  3. If you're using ARC, you'll need to add the -fno-objc-arc compiler flag to Toast+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也可以自己寫

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM