Maui for Android default font size

Haviv Elbsz 1,966 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.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,989 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 37,111 Reputation points Microsoft Vendor
    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