Segmented control in Android

后端 未结 5 528
终归单人心
终归单人心 2020-12-11 18:24

I need to use IPhone like segmented control in Android. Is there a default control for the same? What might be the best and efficient way to do so?

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-11 18:43

    I have achieved it using build in Views.

    MySegmentActivity

    public class SegmentActivity extends AppCompatActivity implements View.OnClickListener {
    
        private Context mContext;
        private List

    layout.

    
    
    
        

    btn_bg_orange.xml

    
    
    
        
    
        
    
    

    btn_bg_orange_selected

    
    
    
        
    
        
    
    

提交回复
热议问题