how to show the widget banner as top bar view for the announcement under the homepage like the preview option while creating the announcement
You can enable the announcement top bar in page settings, but only as a step when publishing a page. In the Publish page dialog and in the Edit publish page dialog (edit page configuration) is the option to turn announcements on for a page.
If you just have your own private page and view page settings, it’s not there. It has to be enabled when the page is published (or afterward by editing the Publish configuration).
Depending on the permissions you may or may not have permission to publish a page.