Skip to content

Add ability to set attributed text on Button #1813

Closed

Description

@PeterStaev

Currently we have this for labels. I think would be good to add this for Buttons as well. Will give user ability to add icon font and text inside buttons or add text with different styles inside the button.

Activity

  1. Daxito commented on Mar 20, 2016

    @Daxito

    +1

  2. pierrediderot commented on Mar 24, 2016

    @pierrediderot

    +1

  3. enchev commented on Mar 25, 2016

    @enchev
    Contributor

    Hey folks,

    As far as I know you can use such styling even now:

    <Page>
      <StackLayout>
        <Button>
          <Button.formattedText>
            <FormattedString>
              <FormattedString.spans>
                <Span ios:text="&#xf179;" android:text="&#xf17b;" fontFamily="FontAwesome" foregroundColor="#ff0000" />
                <Span text=" My" fontAttributes="Bold" foregroundColor="#00ff00" />
                <Span text=" Awesome" backgroundColor="orange" />
                <Span text=" Button" fontAttributes="Italic" foregroundColor="blue" />
              </FormattedString.spans>
            </FormattedString>
          </Button.formattedText>
        </Button>
      </StackLayout>
    </Page>

    ios
    android

    Or you have something else in mind?

    [UPDATE] I've found that currently we have a problem with formattedText on Button in Android and I've made pull request with a fix.

  4. PeterStaev commented on Mar 25, 2016

    @PeterStaev
    ContributorAuthor

    Hey @enchev ,

    Yes, seems that was the problem on Android (I tried it on Android before). Once I removed the default android capitalization the button works as expected 👍

  5. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Mar 28, 2016
  6. added this to the milestone on Mar 28, 2016
  7. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Mar 29, 2016
  8. lock commented on Aug 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  9. locked and limited conversation to collaborators on Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions