メインビューを横に移動して を公開する機能がありUIButton
ます。ビュー内にあるボタンの部分はクリック可能ですが、ボタンの右側はクリックできません。self.view.frame をより大きな数に変更しましたが、まだ同じ問題に直面しています。私も遊んでみましinsertSubview:aboveSubview:
たが、それも役に立ちませんでした。
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
}
編集:私の問題のサンプル プロジェクトをアップロードしましたhttps://dl.dropboxusercontent.com/u/137356839/TestMePlz.zip