samsung-mobile - 如何将手表显示屏旋转到可变角度?
问题描述
我想像现实生活中的指南针一样将手表显示屏旋转到可变角度?到目前为止,我只在 samsung API 中发现了这个函数
screen.lockOrientation("portrait-secondary");
我想要比这更多的控制,如果这意味着使用本机 API,那很好,但我需要关于在哪里查看的帮助。
解决方案
您可以尝试使用evas_map_util_rotate()函数来旋转对象。它根据角度和旋转的中心坐标(旋转点)旋转地图。正角使地图顺时针旋转,而负角使地图逆时针旋转。
请查看此链接的使用实用功能修改地图部分。它包含一个示例,该示例显示如何将对象围绕其中心点顺时针旋转 45 度。
您也可以使用下面的示例代码片段。
@param[in] object_to_rotate The object you want to rotate
@param[in] degree The degree you want to rotate
@param[in] cx The rotation's center horizontal position
@param[in] cy The rotation's center vertical position
void view_rotate_object(Evas_Object *object_to_rotate, double degree, Evas_Coord cx, Evas_Coord cy)
{
Evas_Map *m = NULL;
if (object_to_rotate == NULL) {
dlog_print(DLOG_ERROR, LOG_TAG, "object is NULL");
return;
}
m = evas_map_new(4);
evas_map_util_points_populate_from_object(m, object_to_rotate);
evas_map_util_rotate(m, degree, cx, cy);
evas_object_map_set(object_to_rotate, m);
evas_object_map_enable_set(object_to_rotate, EINA_TRUE);
evas_map_free(m);
}
希望它会有所帮助。
推荐阅读
- php - 一个 Codeigniter 网站和应用程序在一起
- batch-file - SSIS 使用 DTExec.exe 通过批处理文件运行
- macos - 使用tell通过applescript(osascript)生成新应用程序后获取进程ID
- php - 如何在 PHP 中获取通知/警告作为对象?
- r - 基于R中的列值聚合数据框
- php - 更改配置后 Laravel DB 连接不刷新
- firebase - Firebase CLI 命令不适用于 VS Code Git Bash 终端
- java - 大文本数据的非对称密码算法
- reactjs - 在 mapDispatchToProps 之后找不到函数
- javascript - 如何以编程方式检测离子应用程序中是否开启了飞行模式