我有一位观点控制者,通过“[自己的观点加上:第二观点]”补充了另一种观点。 问题是,第二个观点在半部分之外增加。
secondView = [[SecondView alloc] initWithFrame: CGRectMake (-160, 0, 320, 460)];
[self.view addSubview: secondView.view]; "
然而,我已经注意到,0(-160)之前的那部分并非相互猜疑。 这是正常的吗? 是否有办法解决?
谢谢!
我有一位观点控制者,通过“[自己的观点加上:第二观点]”补充了另一种观点。 问题是,第二个观点在半部分之外增加。
secondView = [[SecondView alloc] initWithFrame: CGRectMake (-160, 0, 320, 460)];
[self.view addSubview: secondView.view]; "
然而,我已经注意到,0(-160)之前的那部分并非相互猜疑。 这是正常的吗? 是否有办法解决?
谢谢!
我担心,考虑到<代码>的方式。 UIResponderchain work, 您所希望的是什么是无法直接的(超级概览只能传达给其认为影响自身的事件)。
On the other hand, if you really need to have this view outside of its parent s frame, you could associate a gesture recognizer (reference) to the subview. Indeed, gesture recognizers are handled outside the normal touch event dispatching and it should work.
用于主轴:
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
[secondView addGestureRecognizer:singleTap];
您可以允许通过压倒一切的<代码>点:有:代码>接受母体外的接触。
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
BOOL pointInside = NO;
// step through our subviews frames that exist out of our bounds
for (UIView *subview in self.subviews)
{
if(!CGRectContainsRect(self.bounds, subview.frame) && [subview pointInside:[self convertPoint:point toView:subview] withEvent:event])
{
pointInside = YES;
break;
}
}
// now check inside the bounds
if(!pointInside)
{
pointInside = [super pointInside:point withEvent:event];
}
return pointInside;
}
Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...
I m using Xcode on OSX to develop command line C applications. I would also like to use Instruments to profile and find memory leaks. However, I couldn t find a way to display the console when ...
Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...
I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....
This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...
我跑了X条码,试图把我的手套放在我的电话上。 I m 获取错误信息:“正在设计的方案没有运行”。
Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...
In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...