2 tabs having separate backgrounds with border and there should be distance between those to backgrounds.
Asked
Active
Viewed 317 times
2 Answers
1
You can add those two attributes:
<android.support.design.widget.TabLayout
...
app:tabPaddingStart="10dp"
app:tabPaddingEnd="10dp" />
I found the same question before and you can find the answer there: https://stackoverflow.com/a/36511524/9040853
I hope you find my answer is useful.

Ameen Essa
- 44
- 4
-
thanks for answering but I want individual backgrounds for two tabs. "tabPadding" adds space but in Single tab layout with one background not two separate background for two tabs. – newbie_android_dev Dec 31 '21 at 17:58
-
Do you mean that you want one background for both tabs. One background and above of it the tabs right? – Ameen Essa Dec 31 '21 at 18:07
-
Check this answer https://stackoverflow.com/a/32613364/9040853 I hope it helps you. – Ameen Essa Dec 31 '21 at 18:11
0
Welcome,
Keeping views like this(that tick) on top of another view is called Overlapping Layouts
, you can do it by using relative layout, the gallery view and image view will overlap
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallerylayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Gallery
android:id="@+id/overview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/navigmaske"
android:background="#0000" /*use #000000 for black colour*/
android:src="@drawable/navigmask" //put your image here
android:scaleType="fitXY"
android:layout_alignTop="@id/overview"
android:layout_alignBottom="@id/overview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</RelativeLayout>

Neptotech -vishnu
- 1,096
- 8
- 23