Android - margins specified in custom style not taking effect

前端 未结 3 1217
心在旅途
心在旅途 2020-11-30 10:00

I wish to have the default margin for EditText\'s be 10dp. Therefore, in my styles.xml file I set up the following:



        
3条回答
  •  南笙
    南笙 (楼主)
    2020-11-30 10:28

    Just in case it is useful for others, I'd like bring the answer by Oliv to another SO question here. I was trying to add margins to all buttons and found layout_margin does not work.

    The theme:

    
    

    The button style:

    
    

    Here is button_background.xml where the answer by Oliv to another SO question is used to set the margin to 2dp: :

    
    
        
            
              ...
            
        
    
    

提交回复
热议问题