Changes

Mobile XAML

2,598 bytes added, 6 May
/* Known issues */
{{UnderConstructionStart}}
=== Tooltips not supported on some iOS devices {{Version/MobileSince|5.0}} ===
On iOS, native tooltips are only supported under very specific conditions. According to the official [https://learn.microsoft.com/en-us/dotnet/maui/user-interface/tooltips?view=net-maui-10.0| Microsoft documentation], tooltips are only shown when running the app on macOS with a pointer device. On physical iPhones and iPads, tooltips are generally not displayed. This means that using ToolTipProperties in XAML will not work reliably on iOS mobile devices.
 
A possible workaround is to simulate tooltip behavior using a [https://help.syncfusion.com/maui/popup/overview| SfPopup control]. The idea is to use a tap interaction on the UI element (e.g., via a ''TappedBehavior'' with a ''SetPropertyAction'') that opens a Popup positioned relative to that element, and to automatically close the Popup after a short duration.
 
<syntaxhighlight lang="xml">
<!-- AFTER WORKAROUND -->
xmlns:sfPopup="clr-namespace:Syncfusion.Maui.Popup;assembly=Syncfusion.Maui.Popup"
xmlns:behaviors="clr-namespace:UBIK.MAUI.Behaviors;assembly=UBIK.MAUI"
 
<sfPopup:SfPopup
x:Name="TooltipTextPopup"
AutoCloseDuration="3000"
RelativePosition="AlignTop"
RelativeView="{x:Reference YourUIElement}"
ShowHeader="False">
<sfPopup:SfPopup.ContentTemplate>
<DataTemplate>
<Label Text="This will be displayed as Tooltip text" />
</DataTemplate>
</sfPopup:SfPopup.ContentTemplate>
</sfPopup:SfPopup>
 
<Border x:Name="YourUIElement">
<Border.Behaviors>
<behaviors:TappedBehavior>
<behaviors:SetPropertyAction
PropertyName="IsOpen"
TargetObject="{Binding Source={x:Reference TooltipTextPopup}}"
Value="True" />
</behaviors:TappedBehavior>
</Border.Behaviors>
</Border>
 
<!-- BEFORE WORKAROUND -->
<Border x:Name="YourUIElement">
<ToolTipProperties.Text>
This will NOT be shown on iOS
</ToolTipProperties.Text>
</Border>
</syntaxhighlight>
 
{{Attention|The ''IsOpen'' property on the SfPopup only indicates whether the Popup is open or closed, but it does not replace ''IsVisible''. If there is any Visibility dependency related to other controls, make sure to also set the ''IsVisible'' property on the SfPopup accordingly to prevent possible issues.}}
 
{{UnderConstructionEnd}}
 
[[Category:Client|Xamarin XAML]]
[[Category:Mobile|Mobile XAML]]
[[Category:Pages with broken file links|Xamarin XAML]]
[[Category:Styling|Xamarin XAML]]
[[Category:XAML|Xamarin XAML]]
= UBIK Go (Maui) Customizing Guide {{Version/MobileSince|5.1}} =
746
edits