Why does TextBlock trims ending spaces from the text?

后端 未结 5 2104
粉色の甜心
粉色の甜心 2021-02-19 01:18

Here is my TextBlocks


    

        
5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-19 01:30

    Solved with in a ..

    
        
            
            
        
    
    

    And word wrapping still works

    
        
            
            
        
    
    

    I would easily use Jim's solution (#160;) if wrapping was not an issue.

    In your mind please think about how HTML handles and preserves spaces. This is also how XAML handles and preserves spaces. You would think, of course, that inside a TextBlock it would be more literally handled, huh? Well, it is what it is. At least there's a solution.

提交回复
热议问题