Skip to content

Commit

Permalink
no max lines on android labels
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Nov 3, 2017
1 parent 6d06f22 commit d4f6e9c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Android/Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
<ItemGroup>
<Compile Include="AutofillActivity.cs" />
<Compile Include="AutofillCredentials.cs" />
<Compile Include="Controls\CustomLabelRenderer.cs" />
<Compile Include="Controls\CustomSearchBarRenderer.cs" />
<Compile Include="Controls\CustomButtonRenderer.cs" />
<Compile Include="Controls\HybridWebViewRenderer.cs" />
Expand Down
16 changes: 16 additions & 0 deletions src/Android/Controls/CustomLabelRenderer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Bit.Android.Controls;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(Label), typeof(CustomLabelRenderer))]
namespace Bit.Android.Controls
{
public class CustomLabelRenderer : LabelRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
{
base.OnElementChanged(e);
Control.SetMaxLines(int.MaxValue);
}
}
}

0 comments on commit d4f6e9c

Please sign in to comment.