我正在創建一個具有使用片段的導航抽屜的項目。 而我想在第一個片段中出現3個選項卡。 但我無法創建標籤顯示在InicioFragment.class中。我能怎麼做?如何在片段中創建選項卡
InicioFragment.class
package com.menuguru;
public class InicioFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater.inflate(R.layout.fragment_inicio, container, false);
// getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
return rootView;
}
}
這段代碼的標籤總是出現。
您是否希望在片段打開時才顯示它們? –
是的,所以只有當「這個」片段打開 –