maui icon indicating copy to clipboard operation
maui copied to clipboard

Mac Idiom (Device family = 6) Button styling properties not working

Open unctarheel87 opened this issue 1 year ago • 2 comments

Description

When targeting the Mac Idiom for a .Net8 MAUI project, Buttons revert to Mac OS - specific styling. I can successfully map Buttons back to the iPad idiom with a Button Handler method, handler.PlatformView.PreferredBehavioralStyle = UIKit.UIBehavioralStyle.Pad;. However, certain style properties are no longer working, specfically, ContentLayout. This results in being unable to control styling for any Button with a bitmap ImageSource.

Steps to Reproduce

  1. create a new .net8 MAUI App
  2. in the MacCatalyst Platform folder, edit the info.plist to a device family=6
  3. Map Buttons back to the iPad idiom with a ButtonHandler
  4. Attempt to apply ContentLayout to a Button w/ image

Link to public reproduction project repository

https://github.com/unctarheel87/MacIdiomRepro

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

No, this is something new, Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

unctarheel87 avatar Feb 28 '24 14:02 unctarheel87

@unctarheel87 @mikeparker104 the Mac Desktop Idiom controls are limited, not MAUI. There are some properties that you can't change in the desktop idiom with UIKit (as it's mapping to the AppKit version that doesn't support those functions), and there's no way to work around it beyond resetting those buttons to use the iOS versions. If there are functions that you can set with UIButton that do show up on a Catalyst app with the Desktop Idiom that don't show up on MAUI when applying those settings, then there could be a bug to fix. But of the ones you mentioned, they won't work in the UIKit Desktop idiom at all.

These are limitations with the root platform that only Apple could fix.

drasticactions avatar Feb 29 '24 06:02 drasticactions

This will be fixed once this issue is resolved https://github.com/dotnet/maui/issues/22315

We have to switch to the ButtonConfiguration APIs in order for the ContentLayout properties to work on the Mac Idiom

PureWeen avatar May 14 '24 14:05 PureWeen