Material Design (vii)--snackbar

Source: Internet
Author: User

Switching between different views via tab in the app is not a new concept for material design, they are equivalent to the top navigation mode of the home page or the content of different groups within the app (for example, different styles of music).

The Tablayout in the design package now has a fixed tab and a scrolling tab is implemented. For the former, the width of the view is divided between all tabs, and for the latter, the tab does not have a uniform size and can be scrolled horizontally. tab can be added by code:

Tablayout tablayout = ...; 2 Tablayout.addtab (Tablayout.newtab (). SetText (' Tab 1 '));

However, if you are using Viewpager to cross-tab between tabs, you can create tab directly from the Pageradapter Getpagetitle () method, and then use Setupwithviewpager () method to link viewpager and tab. This ensures that the tab check event is updated with Viewpager, and the tab update is selected.

Material Design (vii)--snackbar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.