Commit b6a1015f authored by Yi Su's avatar Yi Su Committed by Commit Bot

Fix bug of VoiceOver does not read out EmptyStateView text in the Tab Grid

The TabGridEmptyStateView is ignored in Voiceover, and changing the constraints
of the view can fix it. There is still a bug that happens when user open the
Voiceover in regular TabGrid for the first time, but that bugs exists before this
CL and will be fixed later.

Bug: 876873
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: Ifb07363b0e216bbb7b0ee4e3c05d7bfd59d4e415
Reviewed-on: https://chromium-review.googlesource.com/1202146Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Yi Su <mrsuyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588853}
parent ab8a0228
...@@ -76,16 +76,15 @@ ...@@ -76,16 +76,15 @@
bottomLabel.textAlignment = NSTextAlignmentCenter; bottomLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:bottomLabel]; [self addSubview:bottomLabel];
[NSLayoutConstraint activateConstraints:@[ [NSLayoutConstraint activateConstraints:@[
[topLabel.topAnchor constraintEqualToAnchor:self.topAnchor],
[topLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], [topLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
[topLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor], [topLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor],
[topLabel.bottomAnchor [topLabel.bottomAnchor
constraintEqualToAnchor:self.centerYAnchor constraintEqualToAnchor:bottomLabel.topAnchor
constant:-kTabGridEmptyStateVerticalMargin / 2.0f], constant:-kTabGridEmptyStateVerticalMargin],
[bottomLabel.topAnchor
constraintEqualToAnchor:self.centerYAnchor
constant:kTabGridEmptyStateVerticalMargin / 2.0f],
[bottomLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], [bottomLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
[bottomLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor], [bottomLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor],
[bottomLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor],
]]; ]];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment