zoukankan      html  css  js  c++  java
  • UIStepper

     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
  • 相关阅读:
    安卓第三次作业
    安卓第二次作业
    十三周作业
    2020年5月28日
    十二周上机练习
    十一周作业
    2020年5月14日
    2020年5月7日上机练习
    第九周练习
    Online Tristesse
  • 原文地址:https://www.cnblogs.com/lantu1989/p/4620121.html
Copyright © 2011-2022 走看看