android-custom Actionbar bug fixes with incomplete left overlay

Source: Internet
Author: User

today encountered a very painful problem, that is, in the custom Actionbar, Setcustomview, the custom view can not cover the entire view, left there is a blank, see :


All the code that can be added has been added, actionbar.setdisplayshowhomeenabled (false);
        actionbar.setdisplayhomeasupenabled (FALSE);
        actionbar.setdisplayshowtitleenabled (false);
        actionbar.setdisplayuselogoenabled (false);
        actionbar.setdisplayoptions (actionbar.display_show_custom);
        actionbar.setdisplayshowcustomenabled (true);
        Actionbar.layoutparams params = new Actionbar.layoutparams ( RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        Actionbar.setcustomview (Mactionbar, params);

But still do not, the last check data only found that Android 5.0 and appcompat-v7:21 Ancionbar replaced with Toobar is such an effect, can not change, may be used R20 (including) the following appcompat-v7:20 can be replaced


And the APPCOMPAT-V7 version I used in the project is 21, code: Compile ' com.android.support:appcompat-v7:21.0.3 '

After the change to 19.1.0 is no problem, changed to compile ' com.android.support:appcompat-v7:19.1.0 '

After that, there will be no problem, so please record.




android-custom Actionbar bug fixes with incomplete left overlay

Related Article

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.