robinmanuelthiel / flexbutton

Flexible button control for Xamarin.Forms
MIT License
240 stars 34 forks source link

Padding not working? #47

Closed RuddyOne closed 5 years ago

RuddyOne commented 6 years ago

Not sure if this is padding but no matter what I do (setting the padding to 0) the text is centered with padding left and right?

I cant really give more then that, the code I'm using is:

            var test = new FlexButton
            {
                Text = "Test",
                FontSize = 14,
                HeightRequest = 26,
                Margin = 0,
                Padding = 0,
                BackgroundColor = Color.Red
            };

And it looks like this: untitled

Any ideas why this is a thing? I need the text as far to the side as possible.

RuddyOne commented 6 years ago

After taking a quick look at your code I'm guessing its this?

                        <Label.Margin>
                            <OnPlatform x:TypeArguments="Thickness" Default="10,0">
                                <On Platform="WinPhone" Value="0,0" />
                            </OnPlatform>
                        </Label.Margin>

I could be wrong but shouldn't this be optional? And also text alignment?

robinmanuelthiel commented 6 years ago

Oh, yes it should totally be optional. The only reason it's default here, is that I want to button to look nice without many configuration. But it's in the nature of this project, that you can customize that!

idchlife commented 4 years ago

@robinmanuelthiel I'm trying to use IconPadding and Padding, but it seems I cannot remove left-right paddings (trying to make text fill almost all available space with padding like 1-2 in rounded button). I tried even using negative values inside IconPadding and Padding.

Is it possible somehow via parameters?