MultiRowColumnTable.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //
  2. // MultiRowColumnTable.h
  3. // IBOSSmini
  4. //
  5. // Created by apple on 16/10/19.
  6. // Copyright © 2016年 elongtian. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @protocol ItemClickDelegate <NSObject>
  10. @optional
  11. - (void)ItemClick:(int)index;
  12. @end
  13. /**
  14. * DataGrid所用数据源对象
  15. */
  16. @interface DataGridComponentDataSource : NSObject
  17. {
  18. /**
  19. * 标题列表
  20. */
  21. NSMutableArray *titles;
  22. /**
  23. * 数据体,其中包函其它列表(NSArray)
  24. */
  25. NSMutableArray *data;
  26. /**
  27. * 列宽
  28. */
  29. NSMutableArray *columnWidth;
  30. /**
  31. * 列高
  32. */
  33. NSMutableArray *columnHeight;
  34. }
  35. @property(strong,nonatomic) NSMutableArray *titles;
  36. @property(strong,nonatomic) NSMutableArray *data;
  37. @property(strong,nonatomic) NSMutableArray *columnWidth;
  38. @property(strong,nonatomic) NSMutableArray *columnHeight;
  39. @end
  40. @interface DataGridScrollView : UIScrollView
  41. @property(strong,nonatomic)id dataGridComponent;
  42. @end
  43. /**
  44. * 数据列表组件,支持上下与左右滑动
  45. */
  46. @interface MultiRowColumnTable : UIView<UIScrollViewDelegate>
  47. {
  48. //左下列视图
  49. DataGridScrollView *vLeft;
  50. //右下列视图
  51. DataGridScrollView *vRight;
  52. //右下列表内容
  53. UIView *vRightContent;
  54. //左下列表内容
  55. UIView *vLeftContent;
  56. //右上标题
  57. UIView *vTopRight;
  58. //左上标题
  59. UIView *vTopLeft;
  60. //列表数据源
  61. DataGridComponentDataSource *dataSource;
  62. //内容总高度
  63. float contentHeight ;
  64. //内容总宽度
  65. float contentWidth;
  66. //单元格默认高度
  67. float cellHeight;
  68. //单元格最大高度
  69. float cellMaxHeight;
  70. //单元格默认宽度
  71. float cellWidth;
  72. }
  73. @property(readonly,nonatomic) DataGridScrollView *vRight;
  74. @property(readonly,nonatomic) DataGridScrollView *vLeft;
  75. @property(readonly,nonatomic) float cellHeight;
  76. @property(strong,nonatomic) DataGridComponentDataSource *dataSource;
  77. @property(assign,nonatomic) CGFloat fontTitleSize;
  78. @property(assign,nonatomic) CGFloat fontContentSize;
  79. @property(strong,nonatomic) id<ItemClickDelegate> clickDelegate;
  80. @property(strong,nonatomic) UIColor *titleBackgroudColor;
  81. /**
  82. * 用数据项填冲数据
  83. */
  84. -(void)fillData;
  85. /**
  86. * 用指定显示区域 与 数据源初始化对象
  87. */
  88. - (id)initWithFrame:(CGRect)aRect data:(DataGridComponentDataSource*)aDataSource;
  89. @end