初始化控件
UIStepper *step = [UIStepper alloc] initWithFram:(CGrectMake(100,100,200,50))];
設置控制器值是否連續(xù)觸發(fā)變化
@property(nonatomic,getter = isContinuous) BOOL continuous;
若設置為YES,則長按會連續(xù)觸發(fā)變化狸页,若為NO啼辣,只有在按鍵結束后棱貌,才會觸發(fā)。
設置長按是否一直觸發(fā)變化
@property(nonatomic) BOOL autorepeat;
若設置為YES制妄,則長按會一直發(fā)生改變迫横,若為NO统扳,則一次點擊只會改變一次值
設置控制器的值是否循環(huán)(到達邊界后,重頭開始贪婉,默認為NO)
@property(nonatomic) BOOL wraps;
設置控制器的值
@property(nonatomic) double value;
設置控制器的最大值和最小值
@property(nonatomic) double minimumValue;//默認為0
@property(nonatomic) double maximumValue;//默認為100
設置控制器的步長
@property(nonatomic) double stepValue;
設置控時器風格背景圖片
-(void)setBackgroundImage:(UIImage *) image forState:(UIControlState)state;
獲取背景圖片
-(UIImage *)BackgroundImageForState:(UIControlState)state;
通過左右按鈕的狀態(tài)設置分割線的圖片
- (void)setDividerImage:(UIImage*)image forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState;
獲取分割線圖片
- (UIImage*)dividerImageForLeftSegmentState:(UIControlState)state rightSegmentState:(UIControlState)state;
設置和獲取加號按鈕的圖片
- (void)setIncrementImage:(UIImage *)image forState:(UIControlState)state;
- (UIImage *)incrementImageForState:(UIControlState)state;
設置和獲取減號按鈕的圖片
- (void)setDecrementImage:(UIImage *)image forState:(UIControlState)state;
- (UIImage *)decrementImageForState:(UIControlState)state;