I have a button with the Feedback Hub icon (Segoe MDL2 Assets), and I wanted to add the text: "Feedback", after the icon, but since I already have the icon it is possible to add the text? Here is an example of my button:
<Button x:Name="feedbackButton"
FontFamily="Segoe MDL2 Assets"
Content=""
Click="feedbackButton_Click"/>
I try: Content=" Feedback";
, but the word "Feedback" dont appears!
Step 1: Add the Row widget inside the ElevatedButton. Step 2: Add the Text('Download') width inside the Row. Step 3: Then add the SizedBox(width: 5,) followed by the actual icon widget i.e. Icon(Icons.
You can achieve that by using a FlatButton that contains a Column (for showing a text below the icon) or a Row (for text next to the icon), and then having an Icon Widget and a Text widget as children.
You can simply add ElevatedButton. icon() widget, you will get the icon property where you can pass Icon data to add Icon on Elevated Button.
Try putting the icon text and text in separate Run
s of a TextBlock
like this -
<Button>
<TextBlock>
<Run Text=""
FontFamily="Segoe MDL2 Assets" />
<Run Text="Feedback" />
</TextBlock>
</Button>
Isn't this what the OP wanted? Why the downvote??
You can place a StackPanel inside your Button and then add as many TextBlocks into your StackPanel as you need:
<Button x:Name="feedbackButton" Click="feedbackButton_Click">
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="Segoe MDL2 Assets" VerticalAlignment="Center"/>
<TextBlock Text="Feedback" VerticalAlignment="Center" Margin="8,0,0,0"/>
</StackPanel>
</Button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With