MainActivity不用写;
自定义一个TabView类,
import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.AttributeSet; import android.view.View; /** * Created by PaBy on 2017/9/12. */ public class TableView extends View { public TableView(Context context) { super(context); init(context,null); } public TableView(Context context, AttributeSet attrs) { super(context, attrs); init(context,attrs); } private Paint tablePaint; private Paint xPaint; private Paint titlePaint; private Paint contentPaint; public void init(Context context, AttributeSet attrs){ tablePaint = new Paint(); xPaint = new Paint();