【发布时间】:2015-09-15 07:19:21
【问题描述】:
当我单击页面底部的按钮时,ScrollView 会跳转到页面顶部。当我始终单击页面底部的 uitexfield 时,也会发生这种情况。我能做些什么让它静止不动? 在 viewDidLoad() 中:
self.scrollView.pagingEnabled=NO;
在 iewDidLayoutSubviews 中:
-(void)viewDidLayoutSubviews{
[super viewDidLayoutSubviews];
self.scrollView.frame=CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
self.scrollView.contentSize = CGSizeMake(SCREEN_WIDTH, 1150);
}
问题是在此处更改按钮的 ImageBackground 时:
- (IBAction)pressedData:(id)sender {
if ( !self.checkDataIsPressed ) {
self.checkData =true;
[self.checkDataPerson setBackgroundImage:
[UIImage imageNamed:@"check_on"]forState:UIControlStateNormal]; //the jumps scrollview is here
}else{
self.checkData =false;
[self.checkDataPerson setBackgroundImage:
[UIImage imageNamed:@"check_off"]forState:UIControlStateNormal]; //the jumps scrollview is here
}
}
【问题讨论】:
-
什么是视图做了布局子视图的方法,,,
-
是动态高度的uiscrollview
标签: ios objective-c uiscrollview uibutton