我目前有一个视图,其中有一个scrollView。在那个scrollView上,我有一个按钮和一个UITableView。在滚动视图中移动按钮 - iOS
鉴于某些条件,我想将这两件事情提出来。我目前正在这样做:
tempFrame = [addressTableView frame];
tempFrame.origin.x = 0.0;
tempFrame.origin.y = 2.0;
tempFrame.size.width = 320.0;
tempFrame.size.height = 103.0;
[addressTableView setFrame:tempFrame];
// [self.scrollView addSubview:self.addressTableView]; (does not do anything)
tempFrame = [buttonContinue frame];
tempFrame.origin.x = 20.0;
tempFrame.origin.y = 40.0;
tempFrame.size.width = 150.0;
tempFrame.size.height = 25.0;
[buttonContinue setFrame:tempFrame];
// [self.scrollView addSubview:self.buttonContinue]; (does not do anything)
此方法适用于没有scrollView的视图。
关于如何在scrollView中正确移动对象的任何提示将不胜感激。
谢谢。
感谢您的答复。不幸的是,这不起作用。我尝试了两种方法。我认为这可能与这个按钮和表视图位于“视图”内的scrollView上有关。但请注意,这两者的“引用插座”都是文件的所有者。 – FidelCashflo
你的按钮是否连接到他们的IBOutlets(并且是那些IBOutlets属性?) – Fluffhead
是的,它们被连接起来,它们也是属性。 – FidelCashflo