BGNameSlider.h 918 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // BGNameSlider.h
  3. // BuguLive
  4. //
  5. // Created by xfg on 2017/2/17.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. /**
  9. 自定义控件: 带标签的slider
  10. 控件格式为: 参数名称 + 滑块 + 当前数值
  11. 通过 onSliderBlock,可以得到滑块值改变的事件
  12. 通过 normalValue, 可以查询到归一化的值(0~1.0)
  13. */
  14. @interface BGNameSlider: UIView
  15. @property (atomic, retain) UILabel *nameL; // 滑块对应参数名称
  16. @property (atomic, retain) UISlider *slider; // 滑块
  17. @property (atomic, retain) UILabel *valueL; // 滑块当前的值
  18. // UIControlEventValueChanged 回调
  19. @property (nonatomic, copy) void(^onSliderBlock)(id sender);
  20. // normalize between 0.0~1.0 [ (value-min)/max ]
  21. @property (atomic, assign) float normalValue;
  22. // 值的小数点位数[0,1,2,3]
  23. @property (atomic, assign) int precision;
  24. // 更新数值
  25. - (void)updateValue;
  26. @end