iOS常用控件

UISwitch & UIActivityIndicatorView
[setOn,isOn]

initWithActivityIndicatorStyle:
startAnimating;
stopAnimating;
isAnimating;
hidesWhenStopped
backgroundColor
color
——————————————————————————
UIStepper
{
    minimumValue
    maximumValue
    value
    stepValue
    wraps 循环
 autorepeat
    continuous
}
——————————————————————————
UISlider
{
    minimumValue
    maximumValue
    value
    minimumTrackTintColor
    maximumTrackTintColor
    minimumValueImage
    maximumValueImage
    setMinimumTrackImage:forState   |træk|
    setMaximumTrackImage:forState
}

- (void)testUISlider {
 
    CGRect newFrame = frame;
    newFrame.size.height = 25;
    UISlider *slider = [[UISlider alloc] initWithFrame:newFrame]; // Default is 0.0-1.0
    // slider.backgroundColor = [UIColor greenColor];
    // slider.minimumValue = 0;
    // slider.maximumValue = 100;
    // slider.minimumTrackTintColor = [UIColor redColor];
    // slider.maximumTrackTintColor = [UIColor blueColor];
    
    
    UIImage *minimumImage = [UIImage imageNamed:@"slider_minimum.png"];
    UIImage *maximumImage = [UIImage imageNamed:@"slider_maximum.png"];
    UIImage *clearImage   = [UIImage imageNamed:@"clear.png"];
    
    UIImageView *minimumImageView = [[UIImageView alloc] initWithFrame:slider.frame];
    minimumImageView.backgroundColor = [UIColor colorWithPatternImage:minimumImage];
    [self.view addSubview:minimumImageView];
    [minimumImageView release];
    UIImageView *maximumImageView = [[UIImageView alloc] initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, 10, slider.frame.size.height)];
    maximumImageView.backgroundColor = [UIColor colorWithPatternImage:maximumImage];
    maximumImageView.tag = kClearImageViewTag;
    [self.view addSubview:maximumImageView];
    [maximumImageView release];
    
    [slider setMinimumTrackImage:clearImage forState:UIControlStateNormal];
    [slider setMaximumTrackImage:clearImage forState:UIControlStateNormal];
    [slider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
    [self.view addSubview:slider];
}

- (void)sliderAction:(UISlider *)slider {
    UIImageView *imageView = (id)[self.view viewWithTag:kClearImageViewTag];
    imageView.frame = CGRectMake(imageView.frame.origin.x, imageView.frame.origin.y, slider.frame.size.width*slider.value, imageView.frame.size.height);
    NSLog(@"%lf", slider.value);
}
—————————————
UISegmentControl
{
    initWithItems
    frame
    tintColor
    segmentedControlStyle
    momentary
    selectedSegmentIndex
    insertSegmentWithTitle:atIndex:animated:
    insertSegmentWithImage:atIndex:animated:
    setWidth:forSegmentAtIndex:
    titleForSegmentAtIndex
    removeSegmentAtIndex:animated:
    removeAllSegments
}
——————————————————————————
UIProgressView
progress [0-1.0]
progressTintColor
trackTintColor
——————————————————————————
UIAlertView
alloc init…
alertViewStyle
title
message
addButtonWithTitle:
buttonTitleAtIndex:
numberOfButtons
cancelButtonIndex
firstOtherButtonIndex:
dismissWithClickedButtonIndex:
textFieldAtIndex:
——————————————————————————
UIActionSheet
alloc init…
addButtonWithTitle
buttonTitleAtIndex:
numberOfButtons
cancelButtonIndex
destructiveButtonIndex;
dismissWithClickedButtonIndex:animated:
——————————————————————————
UITextView
backgroundColor
textColor
font
delegate
returnKeyType
scrollEnabled
圆角和边线
退出键盘的方式:
1. textView:shouldChangeTextInRange:replacementText:
2. 设置inputAccessoryView
3. touchesBegin:
——————————————————————————
UIWebView


你可能感兴趣的:(iOS开发)