How to set margins to a custom dialog?

前端 未结 15 1212
再見小時候
再見小時候 2020-12-05 05:56

Does anybody knows how can I set margins to a custom dialog? I\'m asking because I\'ve a custom dialog but when displayed it stretches to fill the parent, even though I set

15条回答
  •  庸人自扰
    2020-12-05 06:31

    A simple solution that worked for me was to wrap my entire View in another one, and set the margin to which is now the inner View.

    
    
        
    
        ... Buttons, TextViews, etc
    
        
    
    
    

    Obs: that worked when I wanted margins within my AlertDialog. Not regarding the screen.

提交回复
热议问题