Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create center raised tabbar?

I want to create the TabBar as like Below image:

enter image description here

Here, all tab bar are normal. Just they are custom made. Now i want to create the Tab Bar as like above image. In which the center Tab is raised.

So what should i have do to make it possible ?

If is there any demo then it will be good.

Please help me.

like image 360
Shreyash Mahajan Avatar asked Dec 27 '22 00:12

Shreyash Mahajan


1 Answers

you can set the Background image in Tab widget as

tabHost.getTabWidget().getChildAt(0).setBackgroundResource(R.drawable.home_h);
tabHost.getTabWidget().getChildAt(1).setBackgroundResource(R.drawable.live);
tabHost.getTabWidget().getChildAt(2).setBackgroundResource(R.drawable.camera);
tabHost.getTabWidget().getChildAt(3).setBackgroundResource(R.drawable.profile);
tabHost.getTabWidget().getChildAt(4).setBackgroundResource(R.drawable.Messege);

create the image as other four like Their Top 20% as Transparent and middle camera create as your Curve base . you will achieve your goal as this.

Like this where grey part is Transparency part. enter image description here

enter image description here

like image 180
Hardik Gajjar Avatar answered Jan 13 '23 15:01

Hardik Gajjar