I have a function where I move the main view to the side to expose a UIButton
. The part of the button that's inside the view is clickable but the right side of the button is not.
I've changed the self.view.frame to a much bigger number but I'm still facing the same problem. I've also tried playing around with insertSubview:aboveSubview:
but that also didn't helped.
self.view.frame = CGRectMake(0, 0, 1600, 568);
_testView = [[UIView alloc]initWithFrame:CGRectMake(300, 20, 120, 100)];
_testView.backgroundColor = [UIColor greenColor];
UIButton *test = [UIButton buttonWithType:UIButtonTypeRoundedRect];
test.frame = CGRectMake(0, 0, 120, 100);
[test addTarget:self action:@selector(doSomething) forControlEvents:UIControlEventTouchUpInside];
[_testView addSubview:test];
[self.view addSubview:_testView];
- (void)showRightMenu
{
CGRect frame = self.view.frame;
frame.origin.x = -100;
self.view.frame = frame
}
Edit: I've uploaded a sample project of my problem https://dl.dropboxusercontent.com/u/137356839/TestMePlz.zip