Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Button with Image and Text

$
0
0

Hi,
I have a Button with an Image inside, but my users think that a picture with text would be better. The problem is, when the resolution is not too big, text and image takes too much place. A better solution is, when the display/resolution is big enough, show the picture with text otherwise the image only. I took a look into the VisualStateManager stuff, but do not know how I to trigger the different states by changing the resolution. This XAML style I place into the button style:

               <VisualStateManager.VisualStateGroups>
                    <VisualStateGroup x:Name="ShowTextStates">
                        <VisualState x:Name="ShowText">
                            <VisualState.Setters>
                                <Setter Property="Text" Value="Test test test..." />
                            </VisualState.Setters>
                        </VisualState>
                        <VisualState x:Name="HideText">
                            <VisualState.Setters>
                                <Setter Property="Text" Value="" />
                            </VisualState.Setters>
                        </VisualState>
                    </VisualStateGroup>
                </VisualStateManager.VisualStateGroups>

How can I solve this problem? Any suggestions? Thank you!


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>