mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-07 09:20:04 +01:00
bottom border for ios entry
This commit is contained in:
parent
e9b55bc207
commit
d44950d46c
@ -6,6 +6,8 @@
|
||||
ApplyToDerivedTypes="True">
|
||||
<Setter Property="PlaceholderColor"
|
||||
Value="{StaticResource InputPlaceholderColor}" />
|
||||
<Setter Property="Margin"
|
||||
Value="0, 5, 0, 12" />
|
||||
</Style>
|
||||
<Style TargetType="Editor"
|
||||
ApplyToDerivedTypes="True">
|
||||
|
@ -15,7 +15,9 @@ namespace Bit.iOS.Renderers
|
||||
base.OnElementChanged(e);
|
||||
if(Control != null && e.NewElement is Entry)
|
||||
{
|
||||
Control.ClearButtonMode = UITextFieldViewMode.WhileEditing;
|
||||
UpdateFontSize();
|
||||
SetBottomBorder();
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,5 +47,26 @@ namespace Bit.iOS.Renderers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetBottomBorder()
|
||||
{
|
||||
Control.BorderStyle = UITextBorderStyle.None;
|
||||
var borderLine = new UIView
|
||||
{
|
||||
BackgroundColor = ((Color)Xamarin.Forms.Application.Current.Resources["BoxBorderColor"]).ToUIColor(),
|
||||
TranslatesAutoresizingMaskIntoConstraints = false
|
||||
};
|
||||
Control.AddSubview(borderLine);
|
||||
Control.AddConstraints(new NSLayoutConstraint[]
|
||||
{
|
||||
NSLayoutConstraint.Create(borderLine, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 1f),
|
||||
NSLayoutConstraint.Create(borderLine, NSLayoutAttribute.Leading, NSLayoutRelation.Equal,
|
||||
Control, NSLayoutAttribute.Leading, 1, 0),
|
||||
NSLayoutConstraint.Create(borderLine, NSLayoutAttribute.Trailing, NSLayoutRelation.Equal,
|
||||
Control, NSLayoutAttribute.Trailing, 1, 0),
|
||||
NSLayoutConstraint.Create(borderLine, NSLayoutAttribute.Top, NSLayoutRelation.Equal,
|
||||
Control, NSLayoutAttribute.Bottom, 1, 10f),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user