Maui for Android default font size

Haviv Elbsz 2,071 Reputation points
2024-05-14T06:09:21.7466667+00:00

Hello All. if I have an Entry control that I don't set it's font size. How I can programmatically get it's font size. in other words how I get the default font size of a control that have text in it. Thank you very much.

Developer technologies .NET .NET MAUI
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    2024-05-15T02:10:49.33+00:00

    Hello,

    how I get the default font size of a control that have text in it

    Entry control provides a FontSize property with which you could get the default font size and modify it.

    Console.WriteLine(test_entry.FontSize);
    test_entry.FontSize = 24;
    

    For text controls in Maui, they all have the FontSize property.

    You could refer to Set the font size for more detialed information.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.