1
创建滑块怎样才能让controller1
上下滑动通过它创建slider
我怎么能在UIViewController中
-(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
不上下滑动。
欣赏帮助。
我有点糊涂了,你要根据滑块的值更新视图的由来?如果是这样,你不应该使用'presentModalViewController',因为它完全转换到/从视图,而不是逐步移动。 – axiixc 2012-03-10 20:24:06
在我的viewcontroller我有很多文字可能是2或3页左右。我想添加滑块,以便用户可以上下滑动视图来阅读它。 – user1120133 2012-03-10 20:27:34
为什么不把文本放在UITextView中呢?它将允许用户在不修改视图几何的情况下滚动文本。 – axiixc 2012-03-10 20:30:19