源码简介
本例子是一个关于智能农业的安卓例子源码,仅实现了布局部分。
源码运行截图
源码片段
- private void drawFrame(Canvas canvas){
- calculateLeft();
- //绘制横线
- for(int i=0;i<=xLineCount;i++){
- float startY=i*xInterval+xInterval;
- canvas.drawLine(left+5, startY,getWidth(),startY,paintLine);
- textPaint.setTextAlign(Align.RIGHT);
- canvas.drawText(Math.round(xMaxValue/xLineCount*(xLineCount-i)-0.5)+"",left,startY+bottom/4, textPaint);
- }
- for(int j=0;j<ylinecount;j++){ float="" leftspace="yInterval*j+left+5;" canvas.drawline(leftspace,="" bottom,leftspace,this.getheight()-bottom,paintline);="" textpaint.settextalign(align.center);="" if(j="=0){" continue;="" }="" xpoint.add(leftspace);="" canvas.drawtext(defaultday[j-1],leftspace,this.getheight(),="" textpaint);="" }<="" pre="">
- </ylinecount;j++){>