Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Button/Label Parity #1668

Closed
kingces95 opened this issue Jan 26, 2018 · 35 comments
Closed

[Enhancement] Button/Label Parity #1668

kingces95 opened this issue Jan 26, 2018 · 35 comments

Comments

@kingces95
Copy link
Contributor

kingces95 commented Jan 26, 2018

Rationale

A Button containing text is basically a fancy Label; Options for formatting text on Label make sense to expose on Button. Specifically, justification and line wrapping options are available on Label but not on Button.

see https://forums.xamarin.com/discussion/36779/multi-line-text-on-buttons-how-to-get-consistent-across-platforms

Implementation

Adopt same API on Label for text justification and line wrapping. At least expose HorizontalTextAlignmentProperty, VerticalTextAlignmentProperty, and LineBreakModeProperty.

Expected Result

User is able to justify and control button text using label API.

Implications for CSS

None.

Backward Compatibility

As discussed in the thread, the different platforms have different defaults. We may have to introduce new enum values like Legacy or Undefined or Default.

Difficulty : Moderate

Anything with potential backwards compatibility issues is moderately difficult. Also, the text matrix for this work would be large and clip detection is non-trivial.

@pauldipietro pauldipietro added this to New in Triage Jan 26, 2018
@kingces95 kingces95 added this to Backlog in Enhancements Jan 26, 2018
@kingces95 kingces95 changed the title [Enhancement, Placeholder] iOS: Button: Word wrap [Enhancement] Button/Label Parity Jan 26, 2018
@jassmith jassmith moved this from Backlog to Ready for Implementation in Enhancements Jan 26, 2018
@hartez hartez removed this from New in Triage Jan 29, 2018
@hartez
Copy link
Contributor

hartez commented Jan 29, 2018

@kingces95 @samhouts This appears to mostly be a duplicate of #1659. The only difference I'm seeing is that this issue calls for LineBreakMode support. Should this issue be updated to include only LineBreakMode?

@ice-j
Copy link
Contributor

ice-j commented Jan 30, 2018

@davidortinau I would like to take this issue too, since I'm working on #1659

@davidortinau davidortinau self-assigned this Jan 30, 2018
@davidortinau davidortinau moved this from Ready for Implementation to In Progress in Enhancements Jan 30, 2018
@davidortinau
Copy link
Contributor

@ice-j any progress on this? Any blockers we can help remove?

@ice-j
Copy link
Contributor

ice-j commented Mar 30, 2018

@davidortinau XamarinFormsCommunity#2 (comment)

The way I have implemented it, it also aligns the image (when set) on the button. I'm waiting on any ideas if you have to approach this differently.

@PureWeen PureWeen changed the title [Enhancement] Button/Label Parity [Enhancement] Add LineBreakModeProperty to Button May 7, 2018
@PureWeen PureWeen changed the title [Enhancement] Add LineBreakModeProperty to Button [Enhancement] Button/Label Parity May 7, 2018
@candidodmv
Copy link

Would be amazing to be able align image for each position on the button(Top, Center, Right, Left), mainly 'Center' that usually is needed a workaround with an image to do this.

knocte added a commit to nblockchain/geewallet that referenced this issue Jun 11, 2018
While in Android it still looks ok.

(This is a bit suboptimal way of fixing it, so it's
just a workaround to the fact that VerticalTextAlignment
doesn't exist yet, but might be coming soon:
xamarin/Xamarin.Forms#1668 )
@samhouts
Copy link
Member

@ice-j Are we ready to move this pull request to the main repository?

@samhouts
Copy link
Member

@ice-j Monthly ping! Would you like to submit the pull request here? Thanks!

@ice-j
Copy link
Contributor

ice-j commented Aug 9, 2018

Oh, sorry, there was an unanswered question on the community PR, that's why I didn't move it here, but I will do this weekend and maybe I can continue work here if anyone else doesn't want to take the ticket.

@StephaneDelcroix
Copy link
Member

@ice-j ping

@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Jul 4, 2019
@groege
Copy link

groege commented Aug 23, 2019

@ice-j @StephaneDelcroix
Ping - It's been a while, is there any news?

@samhouts samhouts moved this from In Progress to Ready for Implementation in Enhancements Aug 29, 2019
@samhouts samhouts added proposal-accepted and removed up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! inactive Issue is older than 6 months and needs to be retested proposal-open labels Feb 7, 2020
@EmilAlipiev
Copy link
Contributor

any news on this?

@Happypig375
Copy link
Contributor

@pictos HorizontalTextAlignment and VerticalTextAlignment are still missing.

@pictos
Copy link
Contributor

pictos commented Feb 26, 2020

@Happypig375 I know. For now that PR is solving this issue, which is related to this one. After that PR gets merged, I can work in HorizontalTextAlignment and VerticalTextAlignment

@Happypig375
Copy link
Contributor

@pictos I don't think it being removed from the "In Progress" column of vNext is a sign of merging.

@titoleru
Copy link

Ping - what is the current status of this?

@nonubitta
Copy link

Its sad, such a basic feature already took more than two years and still no clue. 👎
:(

@titoleru
Copy link

come on, we missing the HorizontalTextAlignment & VerticalTextAlignment properties in the Button. Please any updates on this?

@ElVinche
Copy link

Hello, any news about this issue? it's really annoying in some case

@samhouts samhouts moved this from Ready for Implementation to Ready for Implementation-High Interest in Enhancements May 6, 2020
@d617617
Copy link

d617617 commented May 9, 2020

If you use button in grid,the btton's text will be in left. it is bad!we need this change!

@Tommigun1980
Copy link

I think it's quite bad that one of the most frequently used UI elements, a button, does not allow to align its text. These kinds of issues should be absolute top priority for the Xamarin team in my opinion, as it is almost impossible to do anything with Xamarin.Forms without re-creating the entire set of UI widgets. I can not understand how this issue has not even been started yet.

Is there any way the team could fix this as I am getting very tired of implementing primitive UI widgets all the time? I thought this was the exact problem Xamarin.Forms was supposed to solve.

Thank you for considering.

@Tommigun1980
Copy link

Tommigun1980 commented May 11, 2020

@samhouts How are the sprints planned for the Xamarin.Forms team? Are people working on their pet projects, or is there a real vetting process? Please focus on the built-in components to have at least some kind of feature parity with the platforms.

@Tommigun1980
Copy link

Tommigun1980 commented May 11, 2020

Its sad, such a basic feature already took more than two years and still no clue. 👎
:(

I think that the Xamarin.Forms team must be freestyling with things they want to work on, like the "Shell". It's a good example of something they put a lot of resources in which has no real benefit, as it is usable only if you make an application with exactly the components they felt like implementing. While at the same time the primitive UI controls are almost unusable. So I don't think this will get implemented as nobody feels like working on it, even though their product is quite unusable without a base set of features. Please prove me wrong!

@Happypig375
Copy link
Contributor

If there is one thing Xamarin should focus on, it is the 1606 bugs that are still open!

@Happypig375
Copy link
Contributor

The fact that Xamarin.Forms has roughly the same amount of bugs as open issues of mono really speaks for itself.

@Tommigun1980
Copy link

If there is one thing Xamarin should focus on, it is the 1606 bugs that are still open!

Bugs are #1 for sure, that goes without saying. I was referring to development of new features. In that regard I really think they should focus on making the CORE work well.

@d617617
Copy link

d617617 commented May 20, 2020

如果Xamarin应该着重解决一件事,那就是1606个bug仍然存在!

错误肯定是一位的,这毋庸置疑。我指的是开发新功能。在这方面,我真的认为他们应该集中精力使CORE运作良好。
i think it is not possible,you can look the new paltform which name maui.

@Hantick
Copy link

Hantick commented Nov 26, 2020

Still waiting for aligment

@AlaJaber97
Copy link

any progress on this?

@BlueRaja
Copy link

The documentation for Button.ContentLayout says

Gets or sets an object that controls the position of the button image and the spacing between the button's image and the button's text.

This is actually not true since the text is always centered, so the spacing is actually between the button and the left-edge of the box the text is being centered in (leading to every button with an image having off-center text).

This has been known for at least 5 years. It's insane that this still hasn't been fixed...

@jfversluis
Copy link
Member

We won't be investing in this for Xamarin.Forms anymore. I think steps have already been made with this in .NET MAUI. If this is still important to you, make sure to voice any concerns on the .NET MAUI repo. Thanks!

Enhancements automation moved this from Ready for Implementation-High Interest to Closed Nov 4, 2021
@HaufenKlaus
Copy link

HaufenKlaus commented Jan 19, 2023

The documentation for Button.ContentLayout says

Gets or sets an object that controls the position of the button image and the spacing between the button's image and the button's text.

This is actually not true since the text is always centered, so the spacing is actually between the button and the left-edge of the box the text is being centered in (leading to every button with an image having off-center text).

This has been known for at least 5 years. It's insane that this still hasn't been fixed...

i also got the feeling that they don't want to ruin the business model of third party component providers. It's the same with unity: have an abysmally outdated product, let a third party swoop in, make customer pay. I can already smell the nepotism

@HaufenKlaus
Copy link

HaufenKlaus commented Jan 19, 2023

for anyone still running into this issue: here's a hacky and Xamarin.Forms worthy (not meant as a compliment) workaround:

Use a Label like this. You can style it like a button and don't need to write extra code for Android and iOS, bc we shouldn't have a DX from the 90s...

<Label
    <Label.GestureRecognizers>
      <TapGestureRecognizer Command="{Binding YourCommand}" />
    </Label.GestureRecognizers>
</Label>

BUT: the tap highlighting wont be there. if someone wants to improve on that that'd be great

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Enhancements
  
Closed
Development

No branches or pull requests