я привязывания, чтобы скрыть свою панель действий во время выполнения, когда я перейти от tab2 к tab1 или TAB3, но его оставляя пустое пространствоДействие бар не скрывается полностью
мою активность: (с TabLayout и 3 фрагментов)
переключился на другую вкладку, панель действий скрыта сейчас, но есть Пустое пространство:
am используя actionBar.hide
/actionBar.show
, любой ключ, как правильно удалить это дополнительное пространство ??? если то, что я пытаюсь достичь невозможно, то, пожалуйста, руководство меня любой альтернативный способ
коды:
ActionBar actionBar;
........
........
actionBar = getSupportActionBar();
........
........
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
if (tab == tab2){
actionBar.show();
}else {
actionBar.hide();
}};
Добавлено Xml коды:
MainActivity, который включает в себя content_main
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="MainActivity"
android:animateLayoutChanges="true">
<include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
content_main :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/main_layout"
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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:animateLayoutChanges="true">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#e4e4e4"
android:elevation="6dp"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fillViewport="false"
android:clickable="false" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@id/tabs"/>
</RelativeLayout>
вы можете разместить свой код? –
вставьте свой код –
@SathishKumarJ проверьте обновленный вопрос –