0
我有一個標題瀏覽定義如下:(在彩色盒是用於各個對象幀)下一/先前UIButtons沒有響應
上述
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」事件中調用。定義
但下一頁和上一頁 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];
編輯:當輸入這個時發現解決方案! 仍然共享。