UI基础控件的使用1
来源:互联网 发布:移动数据开关已关闭 编辑:程序博客网 时间:2024/05/21 22:33
//
// 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
- UI基础控件的使用1
- UI基础----常见控件的使用之TextView
- UI基础----常见控件的使用之EditText
- UI基础----常见控件的使用之Button
- UI基础----基本控件的使用之ImageView
- 微信小程序-UI控件的使用(1)
- IOS UI控件 label基础属性使用
- jQuery UI基础----1jQuery UI的使用
- IOS的UI控件使用
- UI基础-基础控件-0323-xcode使用与UIView的几个基本属性
- UI--普通控件总结1--控件使用
- UI基础_UIActivityIndicatorView的使用
- UI基础控件一
- IOS UI基础控件
- UI基础控件总结
- UI, 基础控件,ToolBar,...
- UI基础控件 Swift
- UI基础控件
- [从头学数学] 第136节 分式
- 浅谈Nginx负载均衡原理与实现
- Android Wi-Fi子系统学习笔记
- 20160315-02-Activity 生命周期
- 百度地图API多行政区域划分
- UI基础控件的使用1
- 关于setNeedsDisplay、setNeedsLayout方法,UIView的layoutSubviews和drawRect方法何时调用
- MediaPlayer--点击按钮,播放语音
- NOPI导出excel
- HBase连接池 -- HTablePool被Deprecated之后
- 逗号表达式
- 20160316-面向对象结束
- 项目生命周期有哪些类型?分别适用于什么情况下?
- 树莓派搭建花生壳