可以在系统模块中,调用windowmanager中屏幕相关的接口SetOrientation(OHOS::Rosen::Orientation::HORIZONTAL)来修改方向
比如,OH 3.1 Release版本,可以在 foundationgraphicstandardframeworksbootanimationsrcmain.cpp中
//1、添加头文件
#include
#include
#include
int main(int argc, const char *argv[])
{
LOG("main enter");
WaitRenderServiceInit();
//2、增加下面两行,设置方向
auto screens = OHOS::Rosen::ScreenManager::GetInstance().GetAllScreens();
screens[0]->SetOrientation(OHOS::Rosen::Orientation::HORIZONTAL);
……
}
可以在系统模块中,调用windowmanager中屏幕相关的接口SetOrientation(OHOS::Rosen::Orientation::HORIZONTAL)来修改方向
比如,OH 3.1 Release版本,可以在 foundationgraphicstandardframeworksbootanimationsrcmain.cpp中
//1、添加头文件
#include
#include
#include
int main(int argc, const char *argv[])
{
LOG("main enter");
WaitRenderServiceInit();
//2、增加下面两行,设置方向
auto screens = OHOS::Rosen::ScreenManager::GetInstance().GetAllScreens();
screens[0]->SetOrientation(OHOS::Rosen::Orientation::HORIZONTAL);
……
}
举报