Tabs to spaces
This commit is contained in:
Родитель
659c6b271a
Коммит
dead93ad2b
|
@ -8,29 +8,29 @@ using Xamarin.Forms.Platform.iOS;
|
|||
[assembly: ExportEffect(typeof(ItalicPlaceholderEffect), nameof(ItalicPlaceholderEffect))]
|
||||
namespace FormsCommunityToolkit.Effects.iOS.Effects
|
||||
{
|
||||
[Preserve(AllMembers = true)]
|
||||
public class ItalicPlaceholderEffect : PlatformEffect
|
||||
{
|
||||
private NSAttributedString _old;
|
||||
[Preserve(AllMembers = true)]
|
||||
public class ItalicPlaceholderEffect : PlatformEffect
|
||||
{
|
||||
private NSAttributedString _old;
|
||||
|
||||
protected override void OnAttached()
|
||||
{
|
||||
var entry = Control as UITextField;
|
||||
if (entry != null && !string.IsNullOrWhiteSpace(entry.Placeholder))
|
||||
{
|
||||
_old = entry.AttributedPlaceholder;
|
||||
var entryFontSize = entry.Font.PointSize;
|
||||
entry.AttributedPlaceholder = new NSAttributedString(entry.Placeholder, font: UIFont.ItalicSystemFontOfSize(entryFontSize));
|
||||
}
|
||||
}
|
||||
protected override void OnAttached()
|
||||
{
|
||||
var entry = Control as UITextField;
|
||||
if (entry != null && !string.IsNullOrWhiteSpace(entry.Placeholder))
|
||||
{
|
||||
_old = entry.AttributedPlaceholder;
|
||||
var entryFontSize = entry.Font.PointSize;
|
||||
entry.AttributedPlaceholder = new NSAttributedString(entry.Placeholder, font: UIFont.ItalicSystemFontOfSize(entryFontSize));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDetached()
|
||||
{
|
||||
var entry = Control as UITextField;
|
||||
if (entry != null)
|
||||
{
|
||||
entry.AttributedPlaceholder = _old;
|
||||
}
|
||||
}
|
||||
}
|
||||
protected override void OnDetached()
|
||||
{
|
||||
var entry = Control as UITextField;
|
||||
if (entry != null)
|
||||
{
|
||||
entry.AttributedPlaceholder = _old;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,10 @@ using Xamarin.Forms;
|
|||
|
||||
namespace FormsCommunityToolkit.Effects
|
||||
{
|
||||
public class ItalicPlaceholderEffect : RoutingEffect
|
||||
{
|
||||
public ItalicPlaceholderEffect() : base("Organon.Effects.ItalicPlaceholderEffect")
|
||||
{
|
||||
}
|
||||
}
|
||||
public class ItalicPlaceholderEffect : RoutingEffect
|
||||
{
|
||||
public ItalicPlaceholderEffect() : base("Organon.Effects.ItalicPlaceholderEffect")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче