HiHope开发者社区
直播中

loveloho

2年用户 6经验值
擅长:嵌入式技术 处理器/DSP 接口/总线/驱动
私信 关注
[问答]

rk3568 OpenHarmony-v3.1-Release版本如果需要改屏幕默认显示方向需要如何做?

比如旋转270°,看log发现在开机后休眠并没有走驱动中的休眠流程,这块要如何添加,看官方文档这块介绍的不是很详细,是否有大神解答下,感谢!!

回帖(6)

jf_47684691

2022-5-9 14:05:35
可以在系统模块中,调用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);
……
}

举报

loveloho

2022-5-11 13:48:07
有木有大佬可以看下怎么处理?
举报

jf_47684691

2022-5-17 17:44:30
可以系统代码中,调用windowmanager的接口SetOrientation(OHOS::Rosen::Orientation::HORIZONTAL)来修改。

比如,OH 3.1 Release版本可以在 foundationgraphicstandardframeworksbootanimationsrcmain.cpp中
#include
#include
#include

int main(int argc, const char *argv[])
{
LOG("main enter");
WaitRenderServiceInit();
//增加下面两行来设置方向
auto screens = OHOS::Rosen::ScreenManager::GetInstance().GetAllScreens();
screens[0]->SetOrientation(OHOS::Rosen::Orientation::HORIZONTAL);
……

}
举报

loveloho

2022-5-18 15:58:00
可以了 非常感谢!!
举报

更多回帖

发帖
×
20
完善资料,
赚取积分