lvgl spinbox(微调框控件)

源代码:

static void spinbox_event_handler(lv_obj_t * obj, lv_event_t event)
{
	if (event == LV_EVENT_VALUE_CHANGED) {
		printf("Value: %d\n", lv_spinbox_get_value(obj));
	}
	else if (event == LV_EVENT_CLICKED) {
		/*For simple test: Click the spinbox to increment its value*/
		lv_spinbox_increment(obj);
	}
}
	//23 微调框控件
	lv_obj_t * spinbox;
	spinbox = lv_spinbox_create(lv_scr_act(), NULL);
	lv_spinbox_set_digit_format(spinbox, 5, 3);
	lv_spinbox_set_step(spinbox, 10);
	lv_spinbox_set_range(spinbox, 0, 100);
	lv_obj_align(spinbox, NULL, LV_ALIGN_IN_LEFT_MID, 0, 60);
	lv_obj_set_event_cb(spinbox, spinbox_event_handler);

效果显示:

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值