UI基础控件的使用1
2016-03-17 09:27
447 查看
//
// ViewController.m
// UI基础控件的使用1
//
// Created by 唐帅 on 15/12/3.
// Copyright ? 2015年 tang. All rights reserved.
//
#import "ViewController.h"
@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
// ViewController.m
// UI基础控件的使用1
//
// Created by 唐帅 on 15/12/3.
// Copyright ? 2015年 tang. All rights reserved.
//
#import "ViewController.h"
@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
相关文章推荐
- GUI - Web前端开发框架
- 评价ui设计作品好坏的八个标准(界面/交互设计研究)
- 为Yahoo! UI Extensions Grid增加内置的可编辑器
- Cocos2d-x UI开发之文本类使用实例
- 谈谈对jquery ui tabs 的理解
- 在IE 浏览器中使用 jquery的fadeIn() 效果 英文字符字体加粗
- UI Events 用户界面事件
- jquery UI Datepicker时间控件的使用方法(基础版)
- Hallo.js基于jQuery UI所见即所得的Web编辑器
- 基于jQuery UI CSS Framework开发Widget的经验
- jquery ui 1.7 ui.tabs 动态添加与关闭(按钮关闭+双击关闭)
- jQuery UI设置固定日期选择特效代码分享
- Jquery ajax 同步阻塞引起的UI线程阻塞问题
- jQuery UI的Dialog无法提交问题的解决方法
- jQuery ui实现动感的圆角渐变网站导航菜单效果代码
- jquery UI Datepicker时间控件的使用方法(终结版)
- jquery UI Datepicker时间控件的使用方法(加强版)
- 关于jQuery UI 使用心得及技巧
- jquery ui dialog替代confirm实例分析
- jQuery ui 1.7更新小结