In iOS once you create a picture button, you possibly can set the button sort to “Customized” to stop the default animations and styling to the button. While you do that, it means that you can set a pressed and default picture and once you press the button they cycle. Test my first two photographs displaying this habits in iOS Xcode with the inexperienced sure button.
I am attempting to duplicate this on my iOS .NET MAUI app in Visible Studio. I take advantage of ImageButton to set the 2 photographs however after I press the button you possibly can see it dims down with a darkish spotlight making it laborious to see the button. How can I make it work in order that I solely see my photographs? As talked about, in Xcode I might simply set the button to “Customized” and it might work. I hooked up the pink button picture to point out the way it works in MAUI.
I noticed data within the docs about picture button handlers however since setting the button to customized in code requires a change within the constructor, I do not see how one can do it because the button already exists within the handler and it does not appear I can recreate it.
How can I get iOS’s customized button sort in MAUI?
Under is my button code.
<ImageButton HorizontalOptions="Fill" VerticalOptions="Fill" Side="AspectFit" FlexLayout.Develop="1" BackgroundColor="Clear" IsOpaque="True">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Title="CommonStates">
<VisualState x:Title="Regular">
<VisualState.Setters>
<Setter Property="Supply" Worth="{Binding YesButtonImageSource, Mode=OneWay}" />
<Setter Property="Scale" Worth="1" />
</VisualState.Setters>
</VisualState>
<VisualState x:Title="Pressed">
<VisualState.Setters>
<Setter Property="Supply" Worth="{Binding YesButtonPressedImageSource, Mode=OneWay}" />
<Setter Property="Scale" Worth="1" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</ImageButton>