如何通过在其中创建controller1
来使slider
向上和向下滑动
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0:{
//Devanagari view display
ButtonViewController *controller1 = [[ButtonViewController alloc]init];
controller1.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc]
initWithRootViewController:controller1];
navigationController.navigationBar.tintColor = [UIColor colorWithHue:2.0/12 saturation:2.0 brightness:4.0/10 alpha:1.0];
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
break;
}
我从User Experience Coding How-To's from Apple Reference
获得此信息,用于创建slider
CGRect frame = CGRectMake(0.0, 0.0, 200.0, 10.0);
UISlider *slider = [[UISlider alloc] initWithFrame:frame];
[slider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
[slider setBackgroundColor:[UIColor clearColor]];
slider.minimumValue = 0.0;
slider.maximumValue = 50.0;
slider.continuous = YES;
slider.value = 25.0;
我在UIText View
controller1
controller1
下面添加了整件事,但{{1}}没有上下滑动。
感谢帮助。
答案 0 :(得分:1)
从我所知道的你要做什么,我认为你应该使用UIScrollView并控制其contentOffset属性。我把一个快速的示例应用程序拼凑在一起,希望它是你想要做的。