Ios UI TableViewCell画外音辅助功能中的按钮
已解决: 我遵循了更新中的链接,现在UITableViewCell的按钮可用于画外音 情况: 我正在为一个应用程序实现VoiceOver可访问性。 我有一个自定义UITableViewCell(下面的代码),通过用户单击该单元格,可以在展开的和正常的视觉(选定的和未选定的)之间切换。根据我的设计,与扩展有关的所有内容都能正常工作。 在自定义UITableViewCell中,我有一个UILabel和两个UIButton。 UILabel由VoiceOver辅助功能识别,但忽略UIButtons 问题是: 我需要VoiceOver辅助功能来识别UIButtons,并阅读它们的辅助功能标签和/或提示 守则:Ios UI TableViewCell画外音辅助功能中的按钮,ios,uitableview,uibutton,accessibility,voiceover,Ios,Uitableview,Uibutton,Accessibility,Voiceover,已解决: 我遵循了更新中的链接,现在UITableViewCell的按钮可用于画外音 情况: 我正在为一个应用程序实现VoiceOver可访问性。 我有一个自定义UITableViewCell(下面的代码),通过用户单击该单元格,可以在展开的和正常的视觉(选定的和未选定的)之间切换。根据我的设计,与扩展有关的所有内容都能正常工作。 在自定义UITableViewCell中,我有一个UILabel和两个UIButton。 UILabel由VoiceOver辅助功能识别,但忽略UIButtons 问
-(id) init{
...
_leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
_rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_leftButton.titleLabel setFont:[UIFont fontWithName:FONT size:12]];
[_rightButton.titleLabel setFont:[UIFont fontWithName:FONT size:12]];
[_leftButton addTarget:self action:@selector(clickButtonLeft:) forControlEvents:UIControlEventTouchUpInside];
[_rightButton addTarget:self action:@selector(clickButtonRight:) forControlEvents:UIControlEventTouchUpInside];
[_leftButton setFrame:CGRectMake(CELL_DETAILS_SIDE_PADDING,
CELL_PADDING + CELL_NORMAL_HEIGHT + CELL_EXPANDED_PADDING - CELL_BUTTON_HEIGHT-7,
70, CELL_BUTTON_HEIGHT)];
[_leftButton setImage:[UIImage imageNamed:@"giftIcon.png"] forState:UIControlStateNormal];
[_leftButton setTitle:@" Gift This" forState:UIControlStateNormal];
[_rightButton setFrame:CGRectMake(self.frame.size.width - 140 - CELL_DETAILS_SIDE_PADDING,
CELL_PADDING + CELL_NORMAL_HEIGHT + CELL_EXPANDED_PADDING - CELL_BUTTON_HEIGHT-7,
140, CELL_BUTTON_HEIGHT)];
[_rightButton setImage:[UIImage imageNamed:@"buyPack.png"] forState:UIControlStateNormal];
[_rightButton setTitle:@" Buy For Yourself" forState:UIControlStateNormal];
_description = [[UILabel alloc] initWithFrame:CGRectMake(CELL_DETAILS_SIDE_PADDING, CELL_PADDING+CELL_NORMAL_HEIGHT+10,
self.frame.size.width - 2*CELL_DETAILS_SIDE_PADDING, 50)];
_description.numberOfLines = 0;
[_description setLineBreakMode:NSLineBreakByWordWrapping];
[_description setFont:[UIFont fontWithName:FONT size:13]];
[_description setBackgroundColor:[UIColor clearColor]];
[_description setTextColor:[UIColor whiteColor]];
}
- (void) expandCell
{
...
[self addSubview:_description];
[self addSubview:_leftButton];
[self addSubview:_rightButton];
}
更新:
看起来所描述的就是方法。另一个堆栈溢出问题有答案。按照答案中的教程进行操作