Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Allocate memory for the UIAlertView
- UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Slider Value" message:@" " delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
- //Allocate memory for the UISlider
- UISlider myslider = [[UISlider alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
- //Add a callback for what function should run when the slider changes values
- [myslider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
- myslider.minimumValue = 0.0;
- myslider.maximumValue = 100.00;
- myslider.value = 75;
- //Allocate memory for the UILabel
- UILabel expirationLabel = [[UILabel alloc] initWithFrame:CGRectMake(115.0, 60.0, 260.0, 25.0)];
- expirationLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:(10.0)];
- expirationLabel.textColor = [UIColor whiteColor];
- expirationLabel.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0];
- expirationLabel.text = @"Heres my text";
- //Add the slider to the Alert
- [myAlertView addSubview:myslider];
- //Add the label to the Alert
- [myAlertView addSubview:expirationLabel];
- //show the alert
- [myAlertView show];
- [myAlertView release];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement