我有A、B、C、D四个碎片。我想在D碎片中隐藏操作栏。
我尝试了getActivity().getActionBar().hide();
,但它没有起作用。
public class Profile extends Fragment {
public Profile() {
// Required empty public constructor
}
public static Profile newInstance(int instance) {
Bundle args = new Bundle();
args.putInt("argsInstance", instance);
Profile profile = new Profile();
profile.setArguments(args);
return profile;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
getActivity().getActionBar().hide();
// Inflate the layout for this fragment
View profile = inflater.inflate(R.layout.fragment_profile, container, false);
return profile;
}
}