码迷,mamicode.com
首页 > 其他好文 > 详细

控件初识

时间:2014-07-09 15:17:12      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:http   os   2014   cti   io   res   

//

//  ViewController.m

//  helloworld

//

//  Created by apple on 14-7-8.

//  Copyright (c) 2014年 戴维营教育. All rights reserved.

//

 

#import "ViewController.h"

 

@interface ViewController ()

            

@property (weak, nonatomic) IBOutlet UIWebView *webView;

@property (weak, nonatomic) IBOutlet UILabel *label;

@property (weak, nonatomic) IBOutlet UITextField *textField;

 

 

@end

 

//点击按钮改变label的内容

@implementation ViewController

- (IBAction)clicked:(id)sender {

    //printf ("hello,clicked\n");

    self.label.text=@"点击!";

}

 

 

 

//点击按钮把文本控件中的内容输到label中

- (IBAction)clickText:(id)sender {

    self.label.text=self.textField.text;

}

 

//网页浏览

- (IBAction)click3:(id)sender {

    //生成网址

    NSURL *url=[NSURL URLWithString:@"http://www.baidu.com"];

    //网址请求

    NSURLRequest *request=[NSURLRequest requestWithURL:url];

    //网页加载

    [self.webView loadRequest:request];

 

}

 

 

- (IBAction)segment:(UISegmentedControl *)sender {

    printf("segment:%d",sender.selectedSegmentIndex);

}

 

//滑块变得输出滑块的程度

- (IBAction)slider:(id)sender {

    UISlider *slide=(UISlider *)sender;

    NSLog(@"slide:%f",slide.value);

}

 

            

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

}

 

- (void)didReceiveMemoryWarning {

    [super didReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}

 

 

 

 

@end

 

控件初识,布布扣,bubuko.com

控件初识

标签:http   os   2014   cti   io   res   

原文地址:http://www.cnblogs.com/lidongq/p/3832329.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!