前段时间有人已经问了这个问题并给出了一些答案,但我并没有真正理解它们中的任何一个.所以我想知道是否有人可以写一个易于理解的教程,如何做下图所示的事情:
http://img208.yfrog.com/img208/6119/screenshotkmr.png
如果有人能分享到如何做到这一点我真是太棒了,因为它看起来非常酷,我很乐意在我的应用程序中使用类似的东西:-)!
我只是无法让我的滚动视图实际滚动..一切都显示正常,除了它只是不会滚动.....这是我的代码:
- (void)viewDidLoad {
[super viewDidLoad];
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 600)];
scrollView.contentSize = CGSizeMake(320, 600);
scrollView.scrollEnabled = YES;
scrollView.clipsToBounds = YES;
[self.view addSubview:scrollView];
planView = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView2 = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView2.frame = CGRectMake(0, 164, 320, 165);
planView3 = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView3.frame = CGRectMake(0, 328, 320, 165);
planView4 = [[WorkoutPlanView alloc] initWithImage:[UIImage imageNamed:@"WorkoutTable.png"]];
planView4.frame = CGRectMake(0, 505, 320, 165);
[scrollView addSubview:planView];
[scrollView addSubview:planView2];
[scrollView addSubview:planView3];
[scrollView addSubview:planView4];
}
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我的应用程序中有两个不同的文本字段,我将它们的.delegate属性设置为:self.现在我实现了uitextfielddelegate协议的不同方法,但我希望能够单独控制两个文本字段.例如,我希望第一个文本字段在编辑开始时执行与第二个文本字段不同的操作...这个问题的唯一解决方案是设置分配不同的委托或者是否有办法在文本字段中执行此操作分配给他们的同一代表?我希望我的问题是可以理解的,我试着解释一下我能做到的最佳方式.....提前感谢!
我想加入uitextfield我的alterview.当用户试图输入文本时,alterview应该向上移动一点,这样键盘就不会重叠,当按下完成键时,键盘应该消失,alertview应该向后移动.
在iOS 3.1.2(以及3.2)中运行它时一切正常但是一旦我尝试在iOS 4下运行它alertview就会显示在错误的位置并且键盘不会消失.有什么建议?这是我的代码:
- (void)addItemAction{
workoutName = [[UIAlertView alloc] initWithTitle:@"New Workout" message:@"Insert the name of your new workout:\n " delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Done", nil];
workoutName.cancelButtonIndex = 0;
UITextField *titleField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 90.0, 260.0, 25.0)];
titleField.delegate = self;
titleField.borderStyle = UITextBorderStyleRoundedRect;
titleField.returnKeyType = UIReturnKeyDone;
[workoutName addSubview:titleField];
[workoutName show];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
- (void)textFieldDidBeginEditing:(UITextField *)textField {
[UIView beginAnimations:nil context:NULL];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, …Run Code Online (Sandbox Code Playgroud) 这物业到底是locationmanager.distancefilter做什么的?它确定didUpdateTolocation调用方法的频率吗?
iphone ×5
objective-c ×3
uitextfield ×2
delegates ×1
ios4 ×1
sdk ×1
uialertview ×1
uiimageview ×1
uiscrollview ×1
uitableview ×1