Is it possible to change actionbar tab indicator programmatically

后端 未结 2 1982
感动是毒
感动是毒 2020-11-30 03:47

How can i change programmatically the selected tab indicator of my action bar ? i have read about tab styling, and Tab.setCustomView() method, but none of these helps :

2条回答
  •  Happy的楠姐
    2020-11-30 04:08

    //your tab bar should be

    
        
    
    
    

    //your tabs_selector.xml should like this

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    // your layer_bg_unselected_tabs should be like this

    
        
            
    
            
        
    
    
        
            
        
    
    

    // your layer_bg_selected_tabs should be like this

    
        
            
    
            
        
    
    
        
            
        
    
    

提交回复
热议问题