How to set Apple Watch title for VoiceOver AccessibilityLabel - accessibility

Is there any way to change the AccessibilityLabel of a WKInterfaceController title?
Or to turn off just the title VoiceOver?
I have shortened the title to X|Y to show the user what they are viewing but this is not very user friendly for someone using VoiceOver as it reads as "X bar Y" when it should either be turned off or read "Item X of Y"
I am doing a hack right now to check for VoiceOver and set the title but this obviously will not display well on a limited size Apple Watch screen:
let voiceOverON: Bool = WKAccessibilityIsVoiceOverRunning()
if voiceOverON
{
self.setTitle("Exercise \(itemSelected + 1) of \(itemsTotal).")
}
else
{
self.setTitle("\(itemSelected + 1)|\(itemsTotal)")
}
Any ideas that might help the visually impaired?
Thanks

RADAR filed: 28355257 - WKInterfaceController does not support Accessibility

Related

MAUI on Windows: Hide or cover the grey fake title bar

While looking for ways to solve the problem of MAUI applications having a grey title bar on Windows, I managed to make the actual, accent-color-respecting title bar reappear by adding a Win32 subclass that intercepts WM_NCCALCIZE and passes it to DefWindowProc. Unfortunately, the grey fake title bar added by WinUI3 is still there, which means I have two title bars now (plus the Shell's navigation bar):
I tried the proposed fix of setting ExtendsContentIntoTitleBar and calling SetTitleBar on the WinUI Window:
var myTitleBar = new Microsoft.UI.Xaml.Controls.TextBlock() {
Name="DummyTitleBar",
Text="Dummy title bar"
};
winuiContentContainer.Children.Add(myTitleBar);
winuiWindow.ExtendsContentIntoTitleBar = true;
winuiWindow.SetTitleBar(myTitleBar);
Unfortunately, instead of replacing the grey title bar with the dummy UIElement (that I planned to later swap for something like a 1-pixel line), it merely draws the element over the grey fake title bar:
I need a way to make the grey fake title bar disappear for good (or at least significantly reduce its height) without harming the real title bar, or cover it with the Shell. Only on Windows, of course.
Edit: To reiterate from the other question, I'm on Windows 10, so I can't use AppWindow.TitleBar which works only on Windows 11.
I covered the default title bar by setting the appwindow in the maui project. You can put the following code in the MainPage.cs:
protected override void OnHandlerChanged()
      {
            base.OnHandlerChanged();
#if WINDOWS
var uiSettings = new Windows.UI.ViewManagement.UISettings();
var color = uiSettings.GetColorValue(Windows.UI.ViewManagement.UIColorType.AccentLight1);
Microsoft.UI.Xaml.Window window = (Microsoft.UI.Xaml.Window)App.Current.Windows.First<Window>().Handler.PlatformView;
IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
Microsoft.UI.WindowId windowId = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(windowHandle);
Microsoft.UI.Windowing.AppWindow appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(windowId);
appWindow.Title = "this is title";
Microsoft.UI.Windowing.AppWindowTitleBar titlebar = appWindow.TitleBar;
 titlebar.BackgroundColor = color;
titlebar.ButtonBackgroundColor = color;
#endif
}

Accessibility: Related Content - Two fingers flick

I have been trying to understand the intent and potential use case to use "Two finger flick right" as explained under Voice over help section on Apple TV. So far my understanding is
Two finger flick right allows voice over to focus on something that is otherwise non-focusable, without moving system focus.
In case of attached screen shot, a user is able to get hint for focus menu option and know more about the option (in this case it will be "Two finger flick right" under the Apple TV logo.
I have been trying to find a good use case where someone may have used it or is aware of any documentation around it's implementation.
This is what my code looks like so far in terms of accessibility attributes
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath) as? AccessibilityTableViewCell else {
return UITableViewCell()
}
cell.titleLabel.text = "Main title for row \(indexPath.row)"
cell.titleLabel.textColor = .black
cell.isAccessibilityElement = true
cell.accessibilityLabel = "Main title for row \(indexPath.row)"
cell.accessibilityHint = "Hint for Main title at row for index \(indexPath.row)"
cell.accessibilityTraits |= UIAccessibilityTraitStaticText
return cell
}
What additional needs to be set to make the hint label as related content to row 2?

UIStatusBar Translucent Style

I've mentioned some new trends in "Segue-Navigation" paradigm from Apple.
In apps like Apple Music, Health or News all main "start-point" controllers do not have navigation bar. Instead - there is a big bold beautiful title.
I'd like to do the same in my app.
I created UITableViewController with static cells. The first one contains title of controller.
But when I scroll up, status bar merges with this cell, so I want this cell to be behind of status bar like in Apple apps.
Solution
let statusBarView = UIView(frame: CGRect(x:0, y:0, width:view.frame.size.width, height: UIApplication.shared.statusBarFrame.height))
let blurEffect = UIBlurEffect(style: .light)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = statusBarView.bounds
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
statusBarView.addSubview(blurEffectView)
UIApplication.shared.windows.first?.addSubview(statusBarView)

iOS 8 Bug with UIImagePickerController Image Crop

I am having an issue with UIImagePickerController with allowsEditing = YES.
I am unable to crop the image from the bottom but also I have an extra empty space on top when moving the crop rectangle.
Also in the method.
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
I log info and it gives me wrong CropRect (which is not square!)
UIImagePickerControllerCropRect = "NSRect: {{0, 357}, {666, 646}}";
UIImagePickerControllerEditedImage = "<UIImage: 0x7f9b8aa47b30> size {640, 618} orientation 0 scale 1.000000";
UIImagePickerControllerMediaType = "public.image";
UIImagePickerControllerOriginalImage = "<UIImage: 0x7f9b8868e5a0> size {1500, 1001} orientation 0 scale 1.000000";
Does anyone has this bug and how do you fix it?
See the picture below
I have no idea how, but i totally removed "View controller-based status bar appearance" key row (just fully delete this row) in .plist file and it fixed this bug
I couldn't set the "View controller-based status bar appearance" to YES, so I have tried to hide the status bar when I show the UIImagePickerController like so:
let imagePickerController = UIImagePickerController()
...
myViewController.present(imagePickerController, animated: true) {
UIView.animate(withDuration: 0.25, animations: {
UIApplication.shared.isStatusBarHidden = true
})
}
Then on the UIImagePickerControllerDelegate didFinishPickingMediaWithInfo I show the status bar, and it worked.

How can I make Tcl/Tk buttons behave like radiobuttons?

According to the ActiveTcl 8.5 Documentation:
ttk::radiobutton widgets are used in groups to show or change a set of mutually-exclusive options. Radiobuttons are linked to a Tcl variable, and have an associated value; when a radiobutton is clicked, it sets the variable to its associated value.
And a more general definition:
You use radio buttons for mutually exclusive settings. Clicking on one causes any other that has been pressed to pop up, just like on an old car radio.
I really prefer to use the look and feel of buttons instead of radio buttons. How can I achieve the same behaviour of radiobuttons in a group of buttons?
I found on http://wiki.tcl.tk/17899 about toggle buttons, but these behaves more like checkbuttons.
Any insights really appreacited. Thank you
You can set the button's relief to maintain it's sunken-ness.
set colours {red blue green}
foreach c $colours {
pack [button .$c -text $c -command [list pushed $c]]
}
proc pushed colour {
puts $colour
set label [.$colour cget -text]
foreach c $::colours {
.$c configure -relief [expr {$c eq $label ? "sunken" : "raised"}]
}
}
Set the radiobuttons' -indicatoron attribute to false.

Resources