I want to set the font-weight to Medium
of a Label.
I search the forums that I should set Font="Medium,22"
but there is no such property .
what should I do?
but I have to add the font files to the xamarin right?
Yes, we need to add font file to our app. And it doesn't have much effect on the size of apk, not increase much.
Answers
Yes, there is no such property
font-weight
for Label.Do you want to set the font size?
Then you can do like this:
For more about font, you can check document Fonts in Xamarin.Forms.
Note:
I'm not sure what features you want, but here are some similar threads about
the weight of the font
, you can check them here:https://stackoverflow.com/questions/54854985/how-can-i-change-the-weight-of-the-font-in-a-label-in-xamarin-forms
https://forums.xamarin.com/discussion/97446/set-font-weight-on-label
Xamarin forums are migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
For more information, please refer to this sticky post.
@jezh I just want to set the font-weight not font-size.
If I want to set the font-weight to 500,how to set it?
As I mentioned above, there is no such property font-weight for Label.
What are you trying to achieve?
@jezh I want to make a medium text.
which is thicker than normal text. but thinner than bold text.
Have you tried the font family ?
Please refer to the following code:
For more details, you can check: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/fonts#set-the-font-family
thank you @jezh
but I have to add the font files to the xamarin right?
the package size will increase much.
Yes, we need to add font file to our app. And it doesn't have much effect on the size of apk, not increase much.
@jezh for example. PingFangSC-Medium has a size of 70MB.