Add drop shadow effects to EditText Field

后端 未结 3 2084
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 03:47

I am trying to design an EditText Field having Shadows (bottom and right side) like this

\"ente

3条回答
  •  长情又很酷
    2020-12-01 04:33

    Well.. @Shalini's answer helped me in this way but still I got another way to achieve 2D shadow with EditText Field and I am going to share with you.

    We need to create custom XML view with three layer for EditText, bottom shadow and right side shadow

    Below is my code.

    res/drawable/edittext_shadow.xml

    
    
    
    
    
        
        
            
                           
            
        
    
        
        
            
                   
            
        
    
        
        
            
                           
            
         
    
    

    Now we can set this shadow view to our TextField using "Background" property

    like this

    res/layout/main.xml

    
                    
       
    

    and the result screen is like I have posted in question above.

    Thanks to SO, sharing knowledge.

提交回复
热议问题