Xamarin.Forms.InputKit icon indicating copy to clipboard operation
Xamarin.Forms.InputKit copied to clipboard

Any way to add a button to where the icon would be?

Open hjavaher opened this issue 5 years ago • 3 comments

Is there any way to add a button to the advancedEntry. I would love to put a button where the icon would be on the right hand of the entry. Is there any way?

hjavaher avatar Apr 02 '19 04:04 hjavaher

@hjavaher That would be awesome feature. I'm adding that TODO List and will include into InputKit.


Until I'll release new version you may try following steps:

XAML file

//...

            <input:AdvancedEntry
                x:Name="advEntry"
                Title="This is Title"
                Placeholder="SamplePlaceholder" />
//...

CS file

var advFrame = advEntry.Children.FirstOrDefault(x => x is Frame) as Frame;
advStackLayout = (advFrame.Content as Grid).Children.FirstOrDefault(x => x is StackLayout) as StackLayout;

advStackLayout .Children.Add(new Button
{
	Text = "My Button",
	BackgroundColor = Color.Accent,
	TextColor = Color.Accent.ToSurfaceColor()
});

Output InputKit Button in AdvancedEntry

enisn avatar Apr 02 '19 06:04 enisn

Man, buddy, you're on top of this. I don't know any other project that the owner is this responsive. Thank you and I will for sure try that!

hjavaher avatar Apr 02 '19 06:04 hjavaher

Man, buddy, you're on top of this. I don't know any other project that the owner is this responsive. Thank you and I will for sure try that!

Thank you for your interest 😄
I'll add this button option as a feature in future versions. But you can use that solution for now 👍

enisn avatar Apr 02 '19 07:04 enisn