- 博客(1)
- 资源 (5)
- 收藏
- 关注
原创 UITableViewCell标识符说明
if(indexPath.row==outArrayRow) { cell.accessoryType=UITableViewCellAccessoryCheckmark; /* UITableViewCellAccessoryCheckmark 一个选择的小钩钩
2014-12-01 14:22:12 451
ios自定义折线图(带动画效果)
用法:
//***************用法*************
NSMutableArray *dataTitleArray=[[NSMutableArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9", nil];
NSMutableArray *dataArray=[[NSMutableArray alloc] initWithObjects:@"86",@"2",@"45",@"92",@"65",@"15",@"37",@"51",@"94",nil];
myLineChat *mylinechart=[[myLineChat alloc] initWithFrame:CGRectMake(10,150, 300, 300)];
mylinechart.backgroundColor=[UIColor clearColor];
mylinechart.titleArray=dataTitleArray;
mylinechart.valueArray=dataArray;
mylinechart.lineChartBgColor=[UIColor whiteColor];
mylinechart.lineTitleWidth=30;
mylinechart.lineBetweenWidth=30;
mylinechart.lineWidth=2;
mylinechart.lineHeight=150;
mylinechart.lineColor=[UIColor purpleColor];
[mylinechart initWithView];
[self.view addSubview:mylinechart];
参数说明:
CAShapeLayer *lineChart:折线线条
UIColor *lineChartBgColor:折线图背景颜色
NSMutableArray *valueArray:折线图值数组
NSMutableArray *titleArray:折线图标题数组(x轴标题)
float lineWith,lineTitleWidth,lineBetweenWidth,lineHeight:分别为折线图折线的宽度、标题宽度、折线间隔宽度、折线高度。
UIColor *lineColor:折线图折线颜色
参数方法:
-(void)initWithView;
必选方法,在设置完所有属性后调用。
2014-10-13
ios自定义柱形图(带动画效果)
用法:
//***********用法************
NSMutableArray *dataTitleArray=[[NSMutableArray alloc] initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9", nil];
NSMutableArray *dataArray=[[NSMutableArray alloc] initWithObjects:@"86",@"2",@"45",@"92",@"65",@"15",@"37",@"51",@"94",nil];
myBarChart *mybarchart=[[myBarChart alloc] initWithFrame:CGRectMake(10,150, 300, 300)];
mybarchart.backgroundColor=[UIColor clearColor];
mybarchart.maxValue=100;
mybarchart.titleArray=dataTitleArray;
mybarchart.valueArray=dataArray;
mybarchart.barChartBgColor=[UIColor whiteColor];
mybarchart.barWidth=30;
mybarchart.barBetweenWidth=30;
mybarchart.barHeight=150;
mybarchart.barBgColor=[UIColor lightGrayColor];
mybarchart.barColor=[UIColor purpleColor];
[mybarchart initWithView];
[self.view addSubview:mybarchart];
参数说明:
UIColor *barChartBgColor:背景颜色
float maxValue:柱形图对应最大值
NSMutableArray *valueArray:对应值数组
NSMutableArray *titleArray:柱形图标题数组(x轴标题)
float barWidth,barBetweenWidth,barHeight:分别为柱形图的宽度、间隔宽度、高度
UIColor *barBgColor,*barColor:分别为柱形图柱状底色背景颜色和柱形图柱状颜色
初始化方法:
-(void)initWithView;
必选方法,在所有属性设置完后调用。
2014-10-13
ios自定义环形进度条
调用方法:
//**********调用**********
myCircleProgress *circleProgress=[[myCircleProgress alloc] initWithFrame:CGRectMake(50, 80, 100, 100)];
circleProgress.trackColor=[UIColor lightGrayColor];
circleProgress.progressColor=[UIColor blueColor];
circleProgress.title.textColor=[UIColor blueColor];
circleProgress.progress=0.9;
circleProgress.progressWidth=2;
circleProgress.time=1.5;
[circleProgress initWithView];
[self.view addSubview:circleProgress];
参数说明:
UILabel *title:环形进度条标题
UIColor *trackColor:环形进度条环形底色
UIColor *progressColor:环形进度条进度条颜色
float progress:进度比例
float progressWidth:环形进度条环形宽度
float time:环形进度条动画时间
还有一些其他成员变量也可自己修改,
2014-10-10
ios自定义下拉框myCombox(基于UItextView)
使用方法:
//---------用法-----------
NSMutableArray *arrayData=[[NSMutableArray alloc] initWithObjects:@"shaosikang1",@"shaosikang2",@"shaosikang3",@"shaosikang4",@"shaosikang5",@"shaosikang6",@"shaosikang7",@"shaosikang8", nil];
myCombox *combox=[[myCombox alloc] initWithFrame:CGRectMake(30, 300, 120, 200)];
combox.arrayData=arrayData;
combox.titleButton.text=@"shaosikang";
combox.titleButton.textColor=[UIColor blueColor];
combox.backgroundColor=[UIColor clearColor];
combox.cellColor=[UIColor brownColor];
combox.cellSelectColor=[UIColor purpleColor];
combox.cellHeight=30;
[combox initWithView];
[self.view addSubview:combox];
接口参数说明:
UIColor *cellColor:为下拉选择框的选项背景颜色
UIColor *cellSelectColor:为下拉选择框的已选项的背景颜色
NSMutableArray *arrayData:为备选数据数组
UILabel *titleButton:为选择项的label
UITextView *textVIew:为下拉选择框主体(下面一层)
float titleHeight,cellHeight:为选中框高度和备选框盖度
int cellNumber:为备选框数目
参数方法说明:
-(void)initWithView;
此方法为类的初始化方法,必须要写且必须要写在设置所有属性后面。(这条非常重要)
委托方法说明:
-(void)myComboxCellTouchDwon:(UILabel *)label
此方法为委托方法。在点击选项框时执行的方法。
2014-10-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人