The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

Issue in aligning text block text in vertical center RRS feed

  • Question

  • Hi,

    I have been developing one UWP application wherein I am using many text blocks. It may be some property tweaks but I am facing this issue when I am getting lot of xD issues for text not center aligned. 

    <Textblock TextAlignment="Center" VerticalAlignment="Center" Text="UWP App Textblock" />

    When I put this text block in a row of any grid, it is shifted upwards. I have to add top padding to make it centralized but it is cumbersome. There must be some mechanism in framework which will make all text center without any padding. 

    I have read multiple post on SO too but I am not getting any concrete answer for this. Can you please suggest something? 


    Monday, November 13, 2017 2:09 PM

All replies

  • Do you want to Textblock aligned or the text inside the Textblock? Is the textblock how you want it until you put it in the Grid? Maybe defining the height and width of the Textblock along with the font size might help to get the look you are going for without adding padding.
    Tuesday, November 14, 2017 4:18 AM