How to draw circle in android by pressing a button?

前端 未结 1 453
無奈伤痛
無奈伤痛 2021-01-26 11:37

I want to show small dots on screen while pressing a button, something like pin code...

switch (view.getId()){
    case R.id.buttonNum1:
               


        
1条回答
  •  后悔当初
    2021-01-26 12:33

    You can achive by creating ripple effect

    create one drawable name like pin_button_ripple in drawable-v21 folder and add bellow code

    
        
            
                
    
            
        
    
    

    Now in Layout file set it as a background of button and define click listener in activity

    You will see the ripple effect in circle shape like we enter Pin number or password via keyboard and showing that effect

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