【发布时间】:2014-12-18 07:45:22
【问题描述】:
我正在尝试在我的视图中添加更多文本字段,正在添加文本字段但按钮未更改框架。它消失在我添加的 uitextfield 中。请让我知道我哪里出错了。谢谢我在这里分享代码sn-p。
-(IBAction)addMore:(id)sender {
UITextField *moreText = [[UITextField alloc] initWithFrame:CGRectMake(20, textfieldy, 280, 44)];
CGRect buttonFrame = self.addmore.frame;
buttonFrame.origin.y += 10;
self.addmore.frame = buttonFrame;
textfieldy = textfieldy + 52;
addMorey = addMorey + 59;
addChecky = addChecky + 63;
[self.scrollView addSubview:moreText];
scrollView.contentSize = CGSizeMake(self.view.window.frame.size.width, 700);
[self.view setNeedsDisplay];
【问题讨论】:
标签: objective-c uiscrollview uibutton uikit