// Created by 妖精的尾巴 on 15-8-17.ide
// Copyright (c) 2015年 妖精的尾巴. All rights reserved.spa
//.net
#import "ViewController.h"3d
@interface ViewController ()<UIAlertViewDelegate,UIActionSheetDelegate>orm
@end get
@implementation ViewControllerit
- (void)viewDidLoadio
{class
[super viewDidLoad];import
/**
*請在這裏調用下面UI控件的方法
*/
}
-(void)viewDidAppear:(BOOL)animated
{
[self createActionSheet];
}
-(void)createActionSheet
{
UIActionSheet* actSheet=[[UIActionSheet alloc]initWithTitle:@"想念是藍色的" delegate:self cancelButtonTitle:@"肯定" destructiveButtonTitle:@"刪除" otherButtonTitles:@"取消", nil];
[actSheet showInView:self.view];
}
-(void)createAlter
{
UIAlertView* alter=[[UIAlertView alloc]initWithTitle:@"愛的國度" message:@"天青色等煙雨,而我在等你,你會在哪裏?" delegate:self cancelButtonTitle:@"等你在彼岸" otherButtonTitles:@"靈犀湖畔", nil];
[alter show];
}
-(void)defineSlider
{
//自定義slider
UISlider* slider=[[UISlider alloc]initWithFrame:CGRectMake(50, 80, 250, 20)];
slider.minimumTrackTintColor=[UIColor greenColor];
slider.maximumTrackTintColor=[UIColor redColor];
slider.minimumValue=0;
slider.maximumValue=100;
[self.view addSubview:slider];
}
-(void)createSlider
{
UISlider* slider=[[UISlider alloc]initWithFrame:CGRectMake(100, 100, 200,10)];
[self.view addSubview:slider];
slider.minimumValue=0;
slider.maximumValue=1;
slider.value=0.1;
[slider addTarget:self action:@selector(changedValue:) forControlEvents:UIControlEventValueChanged];
}
-(void)changedValue:(UISlider*)slider
{
NSLog(@"%.2f",slider.value);
}
#pragma mark - UIAlertViewDelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex==0) {
NSLog(@"宛在水中央");
}
else{
NSLog(@"渭水河畔");
}
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex==0) {
NSLog(@"我會告訴你這是真的");
}
else if (buttonIndex==1)
{
NSLog(@"由於你的心是透明的");
}
else
{
NSLog(@"怒放在花海");
}
}