zoukankan      html  css  js  c++  java
  • [翻译] ClockView 时钟

    ClockView 时钟

    https://github.com/nacho4d/ClockView

    Overview

    ClockView is s simple class that will simulate an analog (or wall like) clock. ClockView makes use of various CALayers so it needs CoreAnimation (add QuartzCore.framework)

    ClockView是一个简单的类用来模拟模拟时钟的。ClockVIew使用了不同的CALayer,所以需要引用CoreAnimation框架。

    How to use

    It can be initialized with the default style:

    他可以使用默认的方式来初始化:

    ClockView *clockView = [[ClockView alloc] initWithFrame:CGRectMake(0, 320, 100, 100)];
    [aView addSubview:clockView];
    [clockView start];
    ... do your thing here :)
    [clockView stop];
    [clockView release];
    

    Or it can be customized:

    或者可以被定制:

    ClockView *clockView = [[ClockView alloc] initWithFrame:CGRectMake(-15, 0, 350, 350)];
    [clockView setClockBackgroundImage:[UIImage imageNamed:@"clock-background.png"].CGImage];
    [clockView setHourHandImage:[UIImage imageNamed:@"clock-hour-background.png"].CGImage];
    [clockView setMinHandImage:[UIImage imageNamed:@"clock-min-background.png"].CGImage];
    [clockView setSecHandImage:[UIImage imageNamed:@"clock-sec-background.png"].CGImage];
    [self.view addSubview:clockView];
    [clockView start];
    ... do your thing here :)
    [clockView stop];
    [clockView release];
    

    Example of ClockView. Big: Customized style, Small: Default style"

  • 相关阅读:
    P2761 软件补丁问题
    CF1335F Robots on a Grid
    [bzoj2088]P3505 [POI2010]TEL-Teleportation
    CF1335E Three Blocks Palindrome
    P3831 [SHOI2012]回家的路
    P4568 [JLOI2011]飞行路线(分层图)
    P4774 [NOI2018]屠龙勇士
    P2480 [SDOI2010]古代猪文
    CF #632 (Div. 2) 对应题号CF1333
    BSGS 和扩展
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/3674573.html
Copyright © 2011-2022 走看看