Contextual Actionbar styles

前端 未结 4 1555
轮回少年
轮回少年 2020-11-28 23:18

I\'m looking for style information on the Contextual Action bar (CAB). I just need to change the colour of the text in fact..

4条回答
  •  爱一瞬间的悲伤
    2020-11-28 23:36

    If you're starting the contextual action mode manually, you can call setTheme() with a new theme before launching it (maybe Theme.AppCompat.Light.DarkActionBar if you're trying to avoid the black-on-black text issue). This will not affect the theme of the current activity if you've already set the activity's content view.

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        setContentView(R.layout.my_activity_layout);
    
        // these lines can occur anywhere so long as you've already 
        // called "setContentView()" on the activity. The theme
        // you set here will apply to the action mode, but not to 
        // the activity.
        setTheme(R.style.Theme_AppCompat_Light_DarkActionBar);
        startSupportActionMode(myActionModeCallback);
    
    }
    

提交回复
热议问题