我是 ios 的初学者 .... 在我的一项活动中,我创建了自定义scrollView
并在其上创建了一些自定义textField
..现在,当我们单击时,textField
我的自定义tableView
将打开,但此表与已经存在的表混合textField
....如果我添加了这个表UIView
然后它不滚动......所以如何覆盖滚动视图textField
和滚动表格textField
......我已经声明了所有table delegates
并且表格正确显示但出现滚动问题......
scrollview=[[UIScrollView alloc]initWithFrame:CGRectMake(0,60,320,540)];
[scrollview setContentSize:CGSizeMake(800,1500)];
scrollview.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
scrollview.autoresizesSubviews = YES;
scrollview.scrollEnabled = YES;
scrollview.delegate = self;
scrollview.directionalLockEnabled = YES;
scrollview.showsVerticalScrollIndicator = YES;
scrollview.showsHorizontalScrollIndicator = YES;
scrollview.autoresizesSubviews = YES;
scrollview.backgroundColor=[UIColor whiteColor];
[self.view addSubview:scrollview];
AdviseDr=[[UITextField alloc]initWithFrame:CGRectMake(150,110,140,30)];
AdviseDr.font = [UIFont boldSystemFontOfSize:15.0];
AdviseDr.borderStyle = UITextBorderStyleLine;
AdviseDr.clearButtonMode = UITextFieldViewModeWhileEditing;
AdviseDr.delegate =self;
AdviseDr.tag=1;
[scrollview addSubview:AdviseDr];
table_AdviseDoctor=[[UITableView alloc]initwithframe:CGRectMake(150,200,170,200)style:UITableViewStylePlain];
table_AdviseDoctor.delegate=self;
table_AdviseDoctor.dataSource=self;
table_AdviseDoctor.layer.borderWidth = 2.0;
table_AdviseDoctor.layer.borderColor = [UIColor grayColor].CGColor;
[self.view addSubview:table_AdviseDoctor];
table_AdviseDoctor.hidden=YES;
Medicalfacility=[[UITextField alloc]initWithFrame:CGRectMake(150,150,170,30)];
Medicalfacility.font = [UIFont boldSystemFontOfSize:15.0];
Medicalfacility.borderStyle = UITextBorderStyleLine;
Medicalfacility.delegate =self;
Medicalfacility.tag=2;
[scrollview addSubview:Medicalfacility];
[Medicalfacility addTarget:self action:@selector(btnpress1:)forControlEvents:UIControlEventEditingDidBegin];