我已经按照图片所示,在导航栏的右边自定义按钮上添加了一个自定义按钮。 我想要去掉按钮后面的空格,让它与屏幕的右边缘相接触,但即使搜索了也找不到解决方案。如果有人能提及如何解决,那就太好了。
这是我正在使用的代码:
这是我正在使用的代码:
UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
aButton.frame = CGRectMake(50.0, 0.0, 60, 44);
UIBarButtonItem *aBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:aButton];
[aButton addTarget:self action:@selector(testButtonControl:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.rightBarButtonItem = aBarButtonItem;