1

I have tried most of the material found in internet but they didn't help.

I have created bottom tabs using FragmentTabHost. Currently, it is not possible to see where tabWidget borders start and end. Therefore, I would like to change the colors for selected and unselected states and play around with text color. Moreover, I would like to remove bottom line. tabStripEnabled = false and .setTabStripEnabled(false); did not help too.

What I have now:

enter image description here

content_main.xml

<android.support.v4.app.FragmentTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".Activities.MainActivity"
tools:showIn="@layout/activity_main">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@android:id/tabs">

    </FrameLayout>

</RelativeLayout>

</android.support.v4.app.FragmentTabHost>

MainActivity.java

public class MainActivity extends AppCompatActivity {

    FragmentTabHost mFragmentTabHost;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        mFragmentTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
        mFragmentTabHost.setup(MainActivity.this, getSupportFragmentManager(), android.R.id.tabcontent);

        mFragmentTabHost.addTab(mFragmentTabHost.newTabSpec("all").setIndicator("All"), AllTabView.class, null);
        mFragmentTabHost.addTab(mFragmentTabHost.newTabSpec("since").setIndicator("Since"), SinceTabView.class, null);
        mFragmentTabHost.addTab(mFragmentTabHost.newTabSpec("until").setIndicator("Until"), UntilTabView.class, null);
    }
}
Marat
  • 6,142
  • 6
  • 39
  • 67

0 Answers0