我有一个应用程序,其中活动和片段,我已经声明在清单中的活动,但对于片段,我想要横向模式它的工作,但在Java代码后,所有布局也在横向模式的变化,我想在几个片段布局应为横向和休息将在纵向模式。
public class CustomizeFragment extends Fragment implements View.OnKeyListener, View.OnClickListener, StringConstants, BundleConstants, NetConstants, AlertDFragment.AlertListener {
private int mAlertIdentifier;
private String TAG = CustomizeFragment.class.getSimpleName();
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.activity_customize, container, false);
// getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
getActivity().setRequestedOrientation(SCREEN_ORIENTATION_LANDSCAPE);
init(rootView);
}
}发布于 2017-08-01 15:03:48
添加所有以横向模式显示的"layout-land“文件夹和以纵向模式显示的所有"layout-port”片段
https://stackoverflow.com/questions/45430987
复制相似问题