本文主要是介绍UI-UISwitch,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
//
// ViewController.m
// UI其它控件
//
// Created by lanqs on 15/1/3.
// Copyright (c) 2015年 Tanqihong. All rights reserved.
//#import "ViewController.h"
#import "nextViewController.h"
@interface ViewController ()- (void)initializeUserInterface;
- (void)nextbuttonPressed:(UIButton *)sender;
- (void)processControl:(UIView *)sender;@end@implementation ViewController- (void)viewDidLoad {[super viewDidLoad];[self initializeUserInterface];}}- (void)processControl:(UIView *)sender{if ([sender isKindOfClass:[UISwitch class]]) {UISwitch *swithControl = (UISwitch *)sender;[self.view setBackgroundColor:swithControl.isOn ? [UIColor colorWithRed:1 green:0.2 blue:0.3 alpha:100] :[UIColor whiteColor]];}
}@end
这篇关于UI-UISwitch的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!