why view in drawerlayout is force scale to fill screen

前端 未结 1 1571
迷失自我
迷失自我 2021-01-26 03:57

here is my test code:



        
1条回答
  •  隐瞒了意图╮
    2021-01-26 04:30

    The first child View of a DrawerLayout is the main content View, and it will be laid out to fill the DrawerLayout regardless of the layout attributes you set on it.

    If you want your TextView to be the size you set, you need to wrap it in another ViewGroup that acts as the main content View. For example:

    
    
        
    
            
    
        
    
        
    
    
    

    0 讨论(0)
提交回复
热议问题