//
// ViewController.m
// UI基础控件的使用1
//
// Created by 唐帅 on 15/12/3.
// Copyright ? 2015年 tang. All rights reserved.
//
#imp
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UISwitch *LeftSwich;
@property (weak, nonatomic) IBOutlet UISwitch *RightSwitch;
@property (weak, nonatomic) IBOutlet UILabel *lblShow;
- (IBAction)btnOK:(id)sender;
- (IBAction)sliderValueChange:(id)sender;
- (IBAction)touchDown:(id)sender;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
//开关控件的使用
-(IBAction)sWtichValueChanged:(id)sender{
UISwitch *witchSwitch=(UISwitch *)sender;
BOOL setting=witchSwitch.isOn;
[self.LeftSwich setOn:setting animated:YES];
[self.RightSwitch setOn:setting animated:YES];
}
- (IBAction)btnOK:(id)sender {
}
//滑块的使用
- (IBAction)sliderValueChange:(id)sender {
UISlider *slider=(UISlider *)sender;
int progressAsInt=(int)slider.value;
NSString *newText=[[NSStringalloc]initWithFormat:@"%d",progressAsInt];
self.lblShow.text=newText;
}
// 分段空间的使用方法
- (IBAction)touchDown:(id)sender {
if(self.LeftSwich.hidden==YES)
{
// 左右开关空间都隐藏
self.RightSwitch.hidden=NO;
self.LeftSwich.hidden=NO;
}
else
{
// 左右开关空间都显示
self.RightSwitch.hidden=YES;
self.LeftSwich.hidden=YES;
}
}
@end
497

被折叠的 条评论
为什么被折叠?



