標籤://// HMPaintView.h// 畫板//// Created by YaguangZhu on 15/9/10.// Copyright (c) 2015年 YaguangZhu. All rights reserved.//#import <UIKit/UIKit.h>@interface HMPaintView : UIView@property(nonatomic,assign)CGFloat
標籤:Android之SurfaceView學習(一)首先我們先來看下官方API對SurfaceView的介紹SurfaceView的API介紹Provides a dedicated drawing surface embedded inside of a view hierarchy. You can control the format of this surface and, if you like, its size; the SurfaceView takes care of
標籤:和餅圖差不多,代碼差別不大//// HMPieView.m// 餅圖//// Created by YaguangZhu on 15/9/9.// Copyright (c) 2015年 YaguangZhu. All rights reserved.//#import "HMPieView.h"#import "UIColor+Random.h"@implementation HMPieView// Only override drawRect: if you perform
標籤:Android裡Scroller類是為了實現View平滑滾動的一個Helper類。通常在自訂的View時使用,在View中定義一個私人成員mScroller = new Scroller(context)。設定mScroller滾動的位置時,並不會導致View的滾動,通常是用mScroller記錄/計算View滾動的位置,再重寫View的computeScroll(),完成實際的滾動。
標籤:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the