mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
bottom border for ios entry
This commit is contained in:
parent
e9b55bc207
commit
d44950d46c
2 changed files with 25 additions and 0 deletions
|
@ -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 a new issue