在做一个电子表格时,边框的设置有时是必不可少的.这一节就来介绍边框,设置时,可以指定边框的位置,边框的种类,边框的顔色. 首先是边框的位置和种类.对单元格设置边框时,有上下左右位置之分,所以POI也准备了四个不同的方法. 上部的边框: setBorderTop public void setBorderTop(short border) set the type of border to use for the top border of the cell Parameters: border
给View控件设置边框,可以动态设置上下左右.通过布局文件就能搞定 1.在drawable文件夹下新建一个shape_main_list_bg.xml文件 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- This is the main color --> <item> <shape> <!-- 边框颜色 --> <