iOS 時鐘:SPClockView

jopen 10年前發布 | 20K 次閱讀 iOS開發 移動開發 SPClockView

原生App時鐘的一個克隆。

SPClockView 特性如下:

  1. 可以設置時區,也可以從列表中選擇時區

  2. 自動檢測日間和夜間,轉換時鐘的背景

  3. 不能用 NSTimer 來規劃時間,不能使用任意的 UI 操作

  4. 點擊來添加和刪除時鐘

  5. 顯示時區的名字和數碼格式的時間

  6. 數碼時鐘來顯示的格式: HH:mm:ss

如何使用

  1. Import the files SPClockView.h and SPClockView.m into your projects.
  2. After adding the SPClockView into your parent view, set its time zone by calling setTimeZone: method.
  3. Digital clock SPDigitalClock is a subclass of UILabel, and is implemented inside the SPClockView class. To set the digital time also call the method setTimeZone: on SPDigitalClock

示例:

  1. SPClockView

    SPClockView *clockView = [[SPClockView alloc] initWithFrame:CGRectMake(0, 0, 140, 140)];
    
    [clockView setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"EDT"]]; // New York
  2. SPDigitalClock

    SPDigitalClock *digClock = [[SPDigitalClock alloc] initWithFrame:CGRectMake(0, 0, 140, 140)];
    
    [digClock setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"EDT"]]; // New York

iOS 時鐘:SPClockView

項目主頁:http://www.baiduhome.net/lib/view/home/1410336859883

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!