Android Showcase View how to use?

后端 未结 5 953
迷失自我
迷失自我 2020-12-06 08:56

Well For Showcase View

\"enter

I using this:

https://github.com/amlcu

5条回答
  •  半阙折子戏
    2020-12-06 09:19

    Here for this I am using this library

    https://github.com/amlcurran/ShowcaseView

    This library works really great. How it works?? Suppose i want to highlight a menu option. Now just add the library and white this code.

        Toolbar toolbar;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        toolbar.inflateMenu(R.menu.menu_main);
        setSupportActionBar(toolbar);
    
        ViewTarget target = new ViewTarget(toolbar.findViewById(R.id.menu_id_launcher));
    
        new ShowcaseView.Builder(this)
                .setContentTitle("Its My Navigation Drawer")
                .setContentText("Click here and you will get options to navigate to other sections.")
                .useDecorViewAsParent() //this is the difference
                .setTarget(target)
                .build();
    }
    

    and finally you have to make your menu show always like this

        
    

    Now just run the app i think this will works perfectly.

提交回复
热议问题