internal static bool UpdateFlowDirection(this UIView view, IVisualElementController controller) { if (controller == null || view == null || !Forms.IsiOS9OrNewer) { return(false); } if (controller is IView v) { var current = view.SemanticContentAttribute; view.UpdateFlowDirection(v); return(current != view.SemanticContentAttribute); } UISemanticContentAttribute updateValue = view.SemanticContentAttribute; if (controller.EffectiveFlowDirection.IsRightToLeft()) { updateValue = UISemanticContentAttribute.ForceRightToLeft; } else if (controller.EffectiveFlowDirection.IsLeftToRight()) { updateValue = UISemanticContentAttribute.ForceLeftToRight; } if (updateValue != view.SemanticContentAttribute) { view.SemanticContentAttribute = updateValue; return(true); } return(false); }
internal static bool UpdateFlowDirection(this UIView view, IVisualElementController controller) { if (controller == null || view == null || !Forms.IsiOS9OrNewer) return false; UISemanticContentAttribute updateValue = view.SemanticContentAttribute; if (controller.EffectiveFlowDirection.IsRightToLeft()) updateValue = UISemanticContentAttribute.ForceRightToLeft; else if (controller.EffectiveFlowDirection.IsLeftToRight()) updateValue = UISemanticContentAttribute.ForceLeftToRight; if (updateValue != view.SemanticContentAttribute) { view.SemanticContentAttribute = updateValue; return true; } return false; }
public static void UpdateFlowDirection(this UIView nativeView, IView view) { UISemanticContentAttribute updateValue = nativeView.SemanticContentAttribute; if (view.FlowDirection == view.Handler?.MauiContext?.GetFlowDirection() || view.FlowDirection == FlowDirection.MatchParent) { updateValue = UISemanticContentAttribute.Unspecified; } else if (view.FlowDirection == FlowDirection.RightToLeft) { updateValue = UISemanticContentAttribute.ForceRightToLeft; } else if (view.FlowDirection == FlowDirection.LeftToRight) { updateValue = UISemanticContentAttribute.ForceLeftToRight; } if (updateValue != nativeView.SemanticContentAttribute) { nativeView.SemanticContentAttribute = updateValue; } }
public static void UpdateFlowDirection(this UIView platformView, IView view) { UISemanticContentAttribute updateValue = platformView.SemanticContentAttribute; switch (view.FlowDirection) { case FlowDirection.MatchParent: updateValue = UISemanticContentAttribute.Unspecified; break; case FlowDirection.LeftToRight: updateValue = UISemanticContentAttribute.ForceLeftToRight; break; case FlowDirection.RightToLeft: updateValue = UISemanticContentAttribute.ForceRightToLeft; break; } if (updateValue != platformView.SemanticContentAttribute) { platformView.SemanticContentAttribute = updateValue; } }
internal extern static IntPtr IntPtr_objc_msgSend(IntPtr receiver, IntPtr selector, UISemanticContentAttribute arg1);