Skip to content

Set LayoutParams for Android 5.0 Toolbar #4

@jaredrummler

Description

@jaredrummler

The Android 5.0 Toolbar adds extra padding, causing TabBarView to not match parent.

lollipop-tbv

Adding the following after calling super(context, attrs, defStyle); in TabBarView fixes the issue:

setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
                LinearLayout.LayoutParams.MATCH_PARENT));

The material design guidelines show that no dividers should be used in tabs. I suggest you remove the dividers to match the new guidelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions