Action bar tabs displayed as a drop-down list

I can not understand this behavior.

I have activity with a fixed tab layout, but:
in the landscape the tabs are displayed as a list, the whule in the tab portrait is displayed as I want.

I read about the split action bar, but I don't think this is the right solution.

Any idea?

EDIT

Here is the activity with the pager:

<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".CapsulesActivity" /> 

And here is the fragment layout:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".CapsulesActivity$DummySectionFragment" > <GridView android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:columnWidth="290dp" android:gravity="center" android:horizontalSpacing="20dp" android:numColumns="auto_fit" android:stretchMode="columnWidth" android:verticalSpacing="20dp" > </GridView> 

I also post images for the portrait and landscape of my application. Landscape

Portrait

+4
source share

Source: https://habr.com/ru/post/1488229/


All Articles