Android Toolbar title centering and font style customization

Source: Internet
Author: User

    1. First find the XML layout file where the toolbar is located, place the toolbar control in a relative layout (relativelayout), and then set the toolbar the title is empty (in the title property Bar casually hit a few spaces can be);
    2. Then add the TextView control to the relative layout where the toolbar is located, and set its Text to the desired title;
    3. The TextView control is set horizontally and vertically (that is, set Layout_centerhorizontal and layout_centervertical);
    4. Finally, you set the font style in the TextView control, as you actually want.

Android Toolbar title centering and font style customization

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.