- UID
- 845
- 麦力
- 12348
- 注册时间
- 2016-5-15
- 最后登录
- 2020-6-18
- 精华
- 1
- 阅读权限
- 100
- 在线时间
- 691 小时
|
这代码是缤纷多显的,月日周是同一图层的,想做成2个单独图层,单独用一个可以正常模拟,2个一起用不行,高手帮看看哪里不对
/*月日文本图层位置*/
#define SHOW_MORE_M_D_ORIGIN_X 0
#define SHOW_MORE_M_D_ORIGIN_Y 46
#define SHOW_MORE_M_D_SIZE_H 12
#define SHOW_MORE_M_D_SIZE_W 128
/*星期文本图层位置*/
#define SHOW_MORE_W_ORIGIN_X 0
#define SHOW_MORE_W_ORIGIN_Y 76
#define SHOW_MORE_W_SIZE_H 12
#define SHOW_MORE_W_SIZE_W 128
//字符串
//月日
char g_show_more_str_month_day[21] = {"0"};
//星期
char g_show_more_str_week[21] = {"0"};
static char wday_str[7][11]={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
//添加月日文本图层
temp_frame.origin.x = SHOW_MORE_M_D_ORIGIN_X;
temp_frame.origin.y = SHOW_MORE_M_D_ORIGIN_Y;
temp_frame.size.h = SHOW_MORE_M_D_SIZE_H;
temp_frame.size.w = SHOW_MORE_M_D_SIZE_W;
display_target_layerText(p_window,&temp_frame,GAlignCenter,GColorWhite,g_show_more_str_month_day,U_ASCII_ARIAL_12);
//获取月日数据
struct date_time datetime_perday;
app_service_get_datetime(&datetime_perday);
sprintf(g_show_more_str_month_day, "%d月%02d日",datetime_perday.mon,datetime_perday.mday);
//添加星期文本图层
temp_frame.origin.x = SHOW_MORE_W_ORIGIN_X;
temp_frame.origin.y = SHOW_MORE_W_ORIGIN_Y;
temp_frame.size.h = SHOW_MORE_W_SIZE_H;
temp_frame.size.w = SHOW_MORE_W_SIZE_W;
display_target_layerText(p_window,&temp_frame,GAlignCenter,GColorWhite,g_show_more_str_week,U_ASCII_ARIAL_12);
//获取 星期 数据
struct date_time datetime_perday;
app_service_get_datetime(&datetime_perday);
sprintf(g_show_more_str_week,"%s",wday_str[datetime_perday.wday]);
|
|