Change padding of tab header in TabbedPage

Hey,

I wanna change header items' padding on Android platform. Can you point me in the right direction?
I'd assume it's either using custom TabbedPageRenderer or via theme. I haven't been able to find the right way .

Thanks in advance

Answers

  • JimmyGarridoJimmyGarrido USXamarin Team Xamurai

    If you are using AppCompat in your project you can use the TabLayout axml file to do this:

    <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" ... app:tabPadding = "5dp" />

    Check out the Android TabLayout documentation to see what else you can customize in the layout file.

    Hope this helps!

  • PetrPikausPetrPikaus CZMember
    edited September 2016

    @JimmyGarrido said:
    If you are using AppCompat in your project you can use the TabLayout axml file to do this:

    <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.TabLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" ... app:tabPadding = "5dp" />

    Check out the Android TabLayout documentation to see what else you can customize in the layout file.

    Hope this helps!

    Hey, I'm using XF and my UI is designed in XAML based share project.

    I'm assuming I can edit the global stylesheet and use the theme to achieve this? I don't know the names though

  • NickKovalskyNickKovalsky USMember ✭✭✭

    To reduce space at the top of TabLayout elements (icons and text) set negative margin of every Tab.CustomView, to reduce space at their bottom set negative bottom padding of the TabLayout itself.

Sign In or Register to comment.