Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 22.214.171.124 release ready!
Owner and Founder. Opencart
In this blog,
We are going to show you how to make custom tabs in android.
Here we customize the tab with icon and text, you can see the icon is horizontally aligned with tab text.
But if you want to place the icon above the tab label, you have to use a custom view to achieving it.
1. Open project level build.gradle and add android design support library com.android.support:design:23.0.1
2. In layout file activity_main.xml and add tablayout and view pager.
3. Create an XML layout named custom_tab.xml under res -> layout for define the custom view for the tab.
4. Create a fragment named Fragment1.java for tab contents
5. In MainActivity.java use the below code for customizing the tab.
If you noticed this function createTabIcons in MainActivity.java, I have used custom_tab.xml layout in each tab.
Maybe this blog is work for you.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
1. From(this): This Obtains the LayoutInflater from the given context.
2. You can find this icons simply under the drawable folders which is under res folder.
FYI: tabTwo.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom);
When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.