Rounded corners for TABS in android

后端 未结 7 2118
甜味超标
甜味超标 2020-12-21 05:35

I want to achieve rounded corners for the tab that I\'ve constructed in my application. So far I was able to come up with this

7条回答
  •  眼角桃花
    2020-12-21 06:09

    I think this can be done with one drawable for one view. For 2 tab need only 2 drawable. This will also worked for tabs with border color.

    1. For Left Tab:

      
      
        
          
      
            
              
                  
      
                  
              
      
            
      
            
              
                  
                  
      
                  
              
            
      
          
        
      
        
          
      
            
              
                  
      
                  
              
      
            
      
            
              
                  
                  
                  
              
            
      
          
      
        
      
      
      

    Left Tab Background Preview:

    1. For Right Tab:

      
      
      
          
              
               
                  
      
                  
               
      
              
      
              
               
                  
                  
      
                  
               
              
      
          
      
      
      
          
            
              
                  
      
                  
              
      
            
      
            
              
                  
                  
                  
              
            
      
          
      
      
      
      
      
      

    Right Tab Background Preview:

    1. If there is more than 2 tabs Then this if for Middle Tab:

      
      
       
      
        
      
          
              
                  
      
                  
              
      
          
      
          
              
                  
                  
      
                  
              
          
      
        
      
       
       
      
         
      
          
              
                  
      
                  
              
      
          
      
          
              
                  
                  
                  
              
          
      
         
      
       
      
      
      

    Middle Tab Background Preview:

    Drawables have both selected and unselected state

提交回复
热议问题