Android questions about toolbar and fragmentactivity

Source: Internet
Author: User

When I encountered the Fragment tab frame at work today, Fragmentactivity was unable to use the toolbar problem. Check a lot of information, in fact, Appcomponent inherited from Fragmentactivity, so appcomponent all the features he also have, so just let your baseactivtiy inherit appcomponent can.
Used in fragment.

((appcompatactivity) getactivity ()). Getsupportactionbar (). Settitle ();

Second, change toolbar overflow Icon

<!--fix overflow button Change button style-<style name="OverFlow"Parent="@android: Style/widget.holo.actionbutton.overflow"> <item name="android:src"> @drawable/ic_action_commit</item> </style> <!--Base application theme. -<style Name="Apptheme"Parent="Theme.AppCompat.Light.NoActionBar"> <!--toolbar (actionbar) Color--<item name="colorprimary"> @color/actioncolor</item> <!--status bar color-<item name="Colorprimarydark"> @color/actioncolor</item> <!--selected Color-<item name="coloraccent"> #F0F0F0 </item> <!--window background color-<item name="Android:windowbackground"> @android:color/white</item> <item name="Actionoverflowbuttonstyle"> @style/overflow</item> </style>

Android questions about toolbar and fragmentactivity

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.