码迷,mamicode.com
首页 > 其他好文 > 详细

UIStepper

时间:2015-07-04 08:27:18      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:

 1 #import "AppDelegate.h"
 2 
 3 @interface AppDelegate ()
 4 
 5 @end
 6 
 7 @implementation AppDelegate
 8 
 9 
10 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
11     self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
12     // Override point for customization after application launch.
13     self.window.backgroundColor = [UIColor whiteColor];
14     
15     UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
16     stepper.minimumValue = 0;
17     stepper.maximumValue = 100;
18     stepper.value = 50;
19     [stepper addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged];
20     
21     [self.window addSubview:stepper];
22     [self.window makeKeyAndVisible];
23     return YES;
24 }
25 
26 - (void)valueChanged:(UIStepper *)sender
27 {
28     NSLog(@"Value = %.0f",sender.value);
29 }
30 
31 
32 @end

 

UIStepper

标签:

原文地址:http://www.cnblogs.com/lantu1989/p/4620121.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!