Skip to content

how to create button of image and text? #231

Answered by sleepyfran
lanyusan asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! I'm guessing you're using the FromString extension defined in the music player example, right? That one returns an Image instead of a IView<Image>, which is what the canvas is expecting.

Try to do something like the following:

Canvas.create [
    Canvas.children [
        Image.create [
            "avares://FuncUITest/Assets/pour-over.jpeg"
            |> Bitmap.create (* This one is defined in that example as well. *)
            |> Image.source
        ]
    ]
]

I haven't tested it, but I think it should work 😃

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@lanyusan
Comment options

@Aytharn
Comment options

@JaggerJo
Comment options

Answer selected by sleepyfran
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants