【问题标题】:How to set fragment orientation landscape when video played?视频播放时如何设置片段方向横向?
【发布时间】:2020-12-15 06:11:52
【问题描述】:

我创建了一个视频播放器,当我播放视频播放器片段时会自动关闭。我在 oncreate 方法中设置了播放器片段方向景观。提前致谢。

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}

【问题讨论】:

    标签: android-studio android-layout android-fragments android-videoview landscape


    【解决方案1】:

    可能重复 Setting the orientation for only 1 fragment in my activity while the rest is in portrait

    如果您创建一个单独的活动并在清单中将其方向设置为横向会更好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-30
      • 1970-01-01
      • 2012-03-16
      相关资源
      最近更新 更多