【发布时间】:2013-06-20 06:34:53
【问题描述】:
我有一个如下定义的标题视图:(彩色框是各个对象的框架)
LeftMost Red Box : UIButton : BackButton
White Box : UIView : LabelsView, Contains Label 1 & Label 2
Green Box + Text : UILabel : Label 1
Red Box + Text : UILabel : Label 2
Second White Box : UIView : NavigationButtonView, Contains Next And Previous Button
Two Rightmost Green Boxes : UIButtons : Next and Previous Button
以上都进入
UIView * myTitleBar;
BackButton 正在工作,并且正在“Touch Up Inside”事件中调用其各自的选择器。
但是 Next 和 Previous UIButtons 定义如下:
UIButton *prevImageButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 10, navButtonWidth, navButtonHeight)];
[prevImageButton addTarget:self action:@selector(prevImageButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[prevImageButton setBackgroundColor:[UIColor greenColor]];
UIButton *nextImageButton = [[UIButton alloc]initWithFrame:CGRectMake(navButtonWidth + navButtonWidth, 10, navButtonWidth, navButtonHeight)];
[nextImageButton addTarget:self action:@selector(nextImageButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[nextImageButton setBackgroundColor:[UIColor greenColor]];
不要回应。
nextImageButtonPressed 定义如下:
- (IBAction)nextImageButtonPressed:(id)sender{
NSLog(@"Function Called");
.
.
.
}
什么可能导致这个问题? 我尝试使用添加按钮 [titleBarLabelView insertSubview:navigationButtonView atIndex:1000];
编辑:在键入此内容时找到了解决方案! 仍在分享。
【问题讨论】:
标签: ios cocoa-touch ios6 uiview uibutton