我想要做的是:UIPickerView - 突出顯示行時觸發的事件
顯示UIPickerView。如果用戶觸摸選定的行,則行被鎖定(它是一個多組件選取器),其他組件可以自由旋轉。如果該行已被鎖定並且用戶觸摸了鎖定的行,則該行將被解鎖並自由旋轉。我已經使用一個按鈕編碼鎖定部分。我想刪除該按鈕並用突出顯示的選取器選項替換。
我曾嘗試:如果
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
}
顯然,這只是火災行尚未已經選定,所以當我接觸的行是在高亮區域,此事件不火。
我又試圖
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"touchesBegan");
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"touchesMoved");
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"touchesEnded");
}
沒有這些事件火災時拾取被觸摸。
關於如何檢測用戶觸摸選取器中突出顯示/選定行時的任何想法?