[英]How to enable user interaction on UITableViewCell contentView while in edit mode?
[英]VoiceOver user interaction inside UITableViewCell
我有一個帶有自定義UITableViewCell CustomCell的UITableView
CustomCell有一些啟用了用戶交互的UILabel
CustomCell實現touchesBegan:
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
UITouch* touch = touches.anyObject;
self.itemSelected=[touch view].tag;
self.viewSelected=[touch view];
[super touchesBegan:touches withEvent:event];
}
如果我沒有啟用VoiceOver,touchBegan被調用,並且正確的視圖被“選中”,這樣做很有用
啟用VoiceOver后,如果我執行“雙擊然后按住”,則會調用touchesBegan,但與觸摸事件關聯的視圖的類型為UITableViewCellContentView。
知道如何保持與tableview單元格中的那些項目的用戶交互嗎?
我嘗試過的失敗了:
- 確保在單元對象上禁用了輔助功能
- 確保在標簽對象上啟用了輔助功能
- 嘗試了標簽的各種特征組合
- 確保啟用了用戶交互標簽
想法?
找到了答案
我需要實現以下方法
- (NSInteger)accessibilityElementCount;
- (id)accessibilityElementAtIndex:(NSInteger)index;
- (NSInteger)indexOfAccessibilityElement:(id)element;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.